Ignore:
Timestamp:
Feb 18, 2016, 4:27:15 PM (10 years ago)
Author:
[email protected]
Message:

Proxy's don't properly handle Symbols as PropertyKeys.
https://bugs.webkit.org/show_bug.cgi?id=154385

Reviewed by Mark Lam and Yusuke Suzuki.

We were converting all PropertyKeys to strings, even when
the PropertyName was a Symbol. In the spec, PropertyKeys are
either a Symbol or a String. We now respect that in Proxy.Get and
Proxy.GetOwnProperty.

  • runtime/Completion.cpp:

(JSC::profiledEvaluate):
(JSC::createSymbolForEntryPointModule):
(JSC::identifierToJSValue): Deleted.

  • runtime/Identifier.h:

(JSC::parseIndex):

  • runtime/IdentifierInlines.h:

(JSC::Identifier::fromString):
(JSC::identifierToJSValue):
(JSC::identifierToSafePublicJSValue):

  • runtime/ProxyObject.cpp:

(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):

  • tests/es6.yaml:
  • tests/stress/proxy-basic.js:

(let.handler.getOwnPropertyDescriptor):

File:
1 edited

Legend:

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

    r196775 r196785  
    105105    MarkedArgumentBuffer arguments;
    106106    arguments.append(target);
    107     arguments.append(jsString(exec, propertyName.uid()));
     107    arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&vm, propertyName.uid())));
    108108    if (exec->hadException())
    109109        return JSValue::encode(jsUndefined());
     
    152152    MarkedArgumentBuffer arguments;
    153153    arguments.append(target);
    154     arguments.append(jsString(exec, propertyName.uid()));
     154    arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&vm, propertyName.uid())));
    155155    if (exec->hadException())
    156156        return false;
Note: See TracChangeset for help on using the changeset viewer.