Ignore:
Timestamp:
Jun 24, 2017, 1:06:47 AM (8 years ago)
Author:
[email protected]
Message:

Remove Reflect.enumerate
https://bugs.webkit.org/show_bug.cgi?id=173806

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-06-24
Reviewed by Yusuke Suzuki.

JSTests:

  • ChakraCore.yaml:
  • es6.yaml:

These tests now fail because they use Reflect.enumerate.

  • test262.yaml:

This test now passes, it checked that Reflect.enumerate is undefined!

  • stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js:

Convert to for..in which presented the original issue. See bug <https://webkit.org/b/149811>

  • stress/reflect-enumerate.js: Removed.

Remove a test solely for Reflect.enumerate.

Source/JavaScriptCore:

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • inspector/JSInjectedScriptHost.cpp:

(Inspector::JSInjectedScriptHost::subtype):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::iteratorEntries):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSPropertyNameIterator.cpp: Removed.
  • runtime/JSPropertyNameIterator.h: Removed.
  • runtime/ReflectObject.cpp:

(JSC::reflectObjectEnumerate): Deleted.

Source/WebInspectorUI:

  • UserInterface/Models/NativeFunctionParameters.js:

Tools:

  • Scripts/run-jsc-stress-tests:

LayoutTests:

  • inspector/model/remote-object-expected.txt:
  • inspector/model/remote-object.html:
  • platform/mac/inspector/model/remote-object-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp

    r217108 r218784  
    3030#include "JSCInlines.h"
    3131#include "JSGlobalObjectFunctions.h"
    32 #include "JSPropertyNameIterator.h"
    3332#include "Lookup.h"
    3433#include "ObjectConstructor.h"
     
    3837static EncodedJSValue JSC_HOST_CALL reflectObjectConstruct(ExecState*);
    3938static EncodedJSValue JSC_HOST_CALL reflectObjectDefineProperty(ExecState*);
    40 static EncodedJSValue JSC_HOST_CALL reflectObjectEnumerate(ExecState*);
    4139static EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState*);
    4240static EncodedJSValue JSC_HOST_CALL reflectObjectGetOwnPropertyDescriptor(ExecState*);
     
    6462    defineProperty           reflectObjectDefineProperty           DontEnum|Function 3
    6563    deleteProperty           JSBuiltin                             DontEnum|Function 2
    66     enumerate                reflectObjectEnumerate                DontEnum|Function 1
    6764    get                      reflectObjectGet                      DontEnum|Function 2
    6865    getOwnPropertyDescriptor reflectObjectGetOwnPropertyDescriptor DontEnum|Function 2
     
    157154}
    158155
    159 // FIXME: Reflect.enumerate is removed in ECMA 2016 draft.
    160 // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.enumerate
    161 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 
    173156// https://tc39.github.io/ecma262/#sec-reflect.get
    174157EncodedJSValue JSC_HOST_CALL reflectObjectGet(ExecState* exec)
Note: See TracChangeset for help on using the changeset viewer.