Changeset 188529 in webkit for trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
- Timestamp:
- Aug 17, 2015, 11:28:19 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
r188384 r188529 37 37 static EncodedJSValue JSC_HOST_CALL reflectObjectDefineProperty(ExecState*); 38 38 static EncodedJSValue JSC_HOST_CALL reflectObjectEnumerate(ExecState*); 39 static EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState*); 39 40 static EncodedJSValue JSC_HOST_CALL reflectObjectGetPrototypeOf(ExecState*); 40 41 static EncodedJSValue JSC_HOST_CALL reflectObjectIsExtensible(ExecState*); … … 55 56 /* Source for ReflectObject.lut.h 56 57 @begin reflectObjectTable 57 apply reflectObjectApply DontEnum|Function 3 58 defineProperty reflectObjectDefineProperty DontEnum|Function 3 59 deleteProperty reflectObjectDeleteProperty DontEnum|Function 2 60 enumerate reflectObjectEnumerate DontEnum|Function 1 61 getPrototypeOf reflectObjectGetPrototypeOf DontEnum|Function 1 62 has reflectObjectHas DontEnum|Function 2 63 isExtensible reflectObjectIsExtensible DontEnum|Function 1 64 ownKeys reflectObjectOwnKeys DontEnum|Function 1 65 preventExtensions reflectObjectPreventExtensions DontEnum|Function 1 66 setPrototypeOf reflectObjectSetPrototypeOf DontEnum|Function 2 58 apply reflectObjectApply DontEnum|Function 3 59 defineProperty reflectObjectDefineProperty DontEnum|Function 3 60 deleteProperty reflectObjectDeleteProperty DontEnum|Function 2 61 enumerate reflectObjectEnumerate DontEnum|Function 1 62 getOwnPropertyDescriptor reflectObjectGetOwnPropertyDescriptor DontEnum|Function 2 63 getPrototypeOf reflectObjectGetPrototypeOf DontEnum|Function 1 64 has reflectObjectHas DontEnum|Function 2 65 isExtensible reflectObjectIsExtensible DontEnum|Function 1 66 ownKeys reflectObjectOwnKeys DontEnum|Function 1 67 preventExtensions reflectObjectPreventExtensions DontEnum|Function 1 68 setPrototypeOf reflectObjectSetPrototypeOf DontEnum|Function 2 67 69 @end 68 70 */ … … 115 117 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.enumerate requires the first argument be an object"))); 116 118 return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), asObject(target))); 119 } 120 121 // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.getownpropertydescriptor 122 EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState* exec) 123 { 124 JSValue target = exec->argument(0); 125 if (!target.isObject()) 126 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.getOwnPropertyDescriptor requires the first argument be an object"))); 127 128 auto key = exec->argument(1).toPropertyKey(exec); 129 if (exec->hadException()) 130 return JSValue::encode(jsUndefined()); 131 132 return JSValue::encode(objectConstructorGetOwnPropertyDescriptor(exec, asObject(target), key)); 117 133 } 118 134
Note:
See TracChangeset
for help on using the changeset viewer.