Changeset 218784 in webkit for trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
- Timestamp:
- Jun 24, 2017, 1:06:47 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp
r217108 r218784 30 30 #include "JSCInlines.h" 31 31 #include "JSGlobalObjectFunctions.h" 32 #include "JSPropertyNameIterator.h"33 32 #include "Lookup.h" 34 33 #include "ObjectConstructor.h" … … 38 37 static EncodedJSValue JSC_HOST_CALL reflectObjectConstruct(ExecState*); 39 38 static EncodedJSValue JSC_HOST_CALL reflectObjectDefineProperty(ExecState*); 40 static EncodedJSValue JSC_HOST_CALL reflectObjectEnumerate(ExecState*);41 39 static EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState*); 42 40 static EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState*); … … 64 62 defineProperty reflectObjectDefineProperty DontEnum|Function 3 65 63 deleteProperty JSBuiltin DontEnum|Function 2 66 enumerate reflectObjectEnumerate DontEnum|Function 167 64 get reflectObjectGet DontEnum|Function 2 68 65 getOwnPropertyDescriptor reflectObjectGetOwnPropertyDescriptor DontEnum|Function 2 … … 157 154 } 158 155 159 // FIXME: Reflect.enumerate is removed in ECMA 2016 draft.160 // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.enumerate161 EncodedJSValue JSC_HOST_CALL reflectObjectEnumerate(ExecState* exec)162 {163 VM& vm = exec->vm();164 auto scope = DECLARE_THROW_SCOPE(vm);165 166 JSValue target = exec->argument(0);167 if (!target.isObject())168 return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral("Reflect.enumerate requires the first argument be an object")));169 scope.release();170 return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), asObject(target)));171 }172 173 156 // https://tc39.github.io/ecma262/#sec-reflect.get 174 157 EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState* exec)
Note:
See TracChangeset
for help on using the changeset viewer.