Changeset 47271 in webkit for trunk/JavaScriptCore
- Timestamp:
- Aug 14, 2009, 12:00:12 AM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r47269 r47271 7 7 * runtime/JSArray.h: 8 8 (JSC::MarkStack::drain): 9 10 2009-08-13 Oliver Hunt <[email protected]> 11 12 Reviewed by Maciej Stachowiak. 13 14 [ES5] Implement Array.isArray 15 https://bugs.webkit.org/show_bug.cgi?id=28296 16 17 Add support for Array.isArray to the Array constructor 18 19 * runtime/ArrayConstructor.cpp: 20 (JSC::ArrayConstructor::ArrayConstructor): 21 (JSC::arrayConstructorIsArray): 22 * runtime/ArrayConstructor.h: 23 * runtime/CommonIdentifiers.h: 24 * runtime/JSArray.h: 25 (JSC::MarkStack::drain): 26 * runtime/JSGlobalObject.cpp: 27 (JSC::JSGlobalObject::reset): 9 28 10 29 2009-08-13 Oliver Hunt <[email protected]> -
trunk/JavaScriptCore/runtime/ArrayConstructor.cpp
r47239 r47271 34 34 35 35 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor); 36 37 static JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList&); 36 38 37 ArrayConstructor::ArrayConstructor(ExecState* exec, PassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype )39 ArrayConstructor::ArrayConstructor(ExecState* exec, PassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype, Structure* prototypeFunctionStructure) 38 40 : InternalFunction(&exec->globalData(), structure, Identifier(exec, arrayPrototype->classInfo()->className)) 39 41 { … … 43 45 // no. of arguments for constructor 44 46 putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete); 47 48 // ES5 49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum); 45 50 } 46 51 … … 84 89 } 85 90 91 JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*, JSObject*, JSValue, const ArgList& args) 92 { 93 if (!args.at(0).isObject()) 94 return jsBoolean(false); 95 return jsBoolean(asObject(args.at(0))->isObject(&JSArray::info)); 96 } 97 86 98 } // namespace JSC -
trunk/JavaScriptCore/runtime/ArrayConstructor.h
r38440 r47271 30 30 class ArrayConstructor : public InternalFunction { 31 31 public: 32 ArrayConstructor(ExecState*, PassRefPtr<Structure>, ArrayPrototype* );32 ArrayConstructor(ExecState*, PassRefPtr<Structure>, ArrayPrototype*, Structure*); 33 33 34 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/JavaScriptCore/runtime/CommonIdentifiers.h
r46963 r47271 48 48 macro(index) \ 49 49 macro(input) \ 50 macro(isArray) \ 50 51 macro(isPrototypeOf) \ 51 52 macro(length) \ -
trunk/JavaScriptCore/runtime/JSGlobalObject.cpp
r47022 r47271 259 259 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get()); 260 260 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, FunctionConstructor::createStructure(d()->functionPrototype), d()->functionPrototype); 261 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype );261 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype, d()->prototypeFunctionStructure.get()); 262 262 JSCell* stringConstructor = new (exec) StringConstructor(exec, StringConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->stringPrototype); 263 263 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, BooleanConstructor::createStructure(d()->functionPrototype), d()->booleanPrototype);
Note:
See TracChangeset
for help on using the changeset viewer.