Changeset 53170 in webkit for trunk/JavaScriptCore/runtime/ObjectConstructor.cpp
- Timestamp:
- Jan 12, 2010, 4:58:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ObjectConstructor.cpp
r51760 r53170 37 37 static JSValue JSC_HOST_CALL objectConstructorGetPrototypeOf(ExecState*, JSObject*, JSValue, const ArgList&); 38 38 static JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyDescriptor(ExecState*, JSObject*, JSValue, const ArgList&); 39 static JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyNames(ExecState*, JSObject*, JSValue, const ArgList&); 39 40 static JSValue JSC_HOST_CALL objectConstructorKeys(ExecState*, JSObject*, JSValue, const ArgList&); 40 41 static JSValue JSC_HOST_CALL objectConstructorDefineProperty(ExecState*, JSObject*, JSValue, const ArgList&); … … 53 54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum); 54 55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().getOwnPropertyDescriptor, objectConstructorGetOwnPropertyDescriptor), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getOwnPropertyNames, objectConstructorGetOwnPropertyNames), DontEnum); 55 57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().keys, objectConstructorKeys), DontEnum); 56 58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 3, exec->propertyNames().defineProperty, objectConstructorDefineProperty), DontEnum); … … 124 126 125 127 return description; 128 } 129 130 // FIXME: Use the enumeration cache. 131 JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyNames(ExecState* exec, JSObject*, JSValue, const ArgList& args) 132 { 133 if (!args.at(0).isObject()) 134 return throwError(exec, TypeError, "Requested property names of a value that is not an object."); 135 PropertyNameArray properties(exec); 136 asObject(args.at(0))->getOwnPropertyNames(exec, properties, IncludeDontEnumProperties); 137 JSArray* names = constructEmptyArray(exec); 138 size_t numProperties = properties.size(); 139 for (size_t i = 0; i < numProperties; i++) 140 names->push(exec, jsOwnedString(exec, properties[i].ustring())); 141 return names; 126 142 } 127 143
Note:
See TracChangeset
for help on using the changeset viewer.