Changeset 121280 in webkit for trunk/Source/JavaScriptCore/runtime/JSArray.h
- Timestamp:
- Jun 26, 2012, 12:42:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSArray.h
r116828 r121280 381 381 return size; 382 382 } 383 384 inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const ArgList& values) 385 { 386 JSGlobalData& globalData = exec->globalData(); 387 unsigned length = values.size(); 388 JSArray* array = JSArray::tryCreateUninitialized(globalData, arrayStructure, length); 389 390 // FIXME: we should probably throw an out of memory error here, but 391 // when making this change we should check that all clients of this 392 // function will correctly handle an exception being thrown from here. 393 if (!array) 394 CRASH(); 395 396 for (unsigned i = 0; i < length; ++i) 397 array->initializeIndex(globalData, i, values.at(i)); 398 array->completeInitialization(length); 399 return array; 400 } 383 401 384 } // namespace JSC 402 inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const JSValue* values, unsigned length) 403 { 404 JSGlobalData& globalData = exec->globalData(); 405 JSArray* array = JSArray::tryCreateUninitialized(globalData, arrayStructure, length); 406 407 // FIXME: we should probably throw an out of memory error here, but 408 // when making this change we should check that all clients of this 409 // function will correctly handle an exception being thrown from here. 410 if (!array) 411 CRASH(); 412 413 for (unsigned i = 0; i < length; ++i) 414 array->initializeIndex(globalData, i, values[i]); 415 array->completeInitialization(length); 416 return array; 417 } 418 419 } // namespace JSC 385 420 386 421 #endif // JSArray_h
Note:
See TracChangeset
for help on using the changeset viewer.