Changeset 188532 in webkit for trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
- Timestamp:
- Aug 17, 2015, 11:56:52 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
r188529 r188532 37 37 static EncodedJSValue JSC_HOST_CALL reflectObjectDefineProperty(ExecState*); 38 38 static EncodedJSValue JSC_HOST_CALL reflectObjectEnumerate(ExecState*); 39 static EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState*); 39 40 static EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState*); 40 41 static EncodedJSValue JSC_HOST_CALL reflectObjectGetPrototypeOf(ExecState*); … … 60 61 deleteProperty reflectObjectDeleteProperty DontEnum|Function 2 61 62 enumerate reflectObjectEnumerate DontEnum|Function 1 63 get reflectObjectGet DontEnum|Function 2 62 64 getOwnPropertyDescriptor reflectObjectGetOwnPropertyDescriptor DontEnum|Function 2 63 65 getPrototypeOf reflectObjectGetPrototypeOf DontEnum|Function 1 … … 119 121 } 120 122 123 // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.get 124 EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState* exec) 125 { 126 JSValue target = exec->argument(0); 127 if (!target.isObject()) 128 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.get requires the first argument be an object"))); 129 130 const Identifier propertyName = exec->argument(1).toPropertyKey(exec); 131 if (exec->hadException()) 132 return JSValue::encode(jsNull()); 133 134 JSValue receiver = target; 135 if (exec->argumentCount() >= 3) 136 receiver = exec->argument(2); 137 138 PropertySlot slot(receiver); 139 return JSValue::encode(target.get(exec, propertyName, slot)); 140 } 141 121 142 // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.getownpropertydescriptor 122 143 EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState* exec)
Note:
See TracChangeset
for help on using the changeset viewer.