Ignore:
Timestamp:
Sep 7, 2012, 3:50:45 PM (13 years ago)
Author:
[email protected]
Message:

Object.prototype.define{G,S}etter with non-callable second parameter should throw TypeError instead of SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=93873

Reviewed by Sam Weinig.

Source/JavaScriptCore:

  • runtime/ObjectPrototype.cpp:

(JSC::objectProtoFuncDefineGetter):

  • throw TypeError instead of SyntaxError

(JSC::objectProtoFuncDefineSetter):

  • throw TypeError instead of SyntaxError

LayoutTests:

  • fast/js/property-getters-and-setters-expected.txt:
    • updated results
File:
1 edited

Legend:

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

    r127505 r127930  
    158158    CallData callData;
    159159    if (getCallData(get, callData) == CallTypeNone)
    160         return throwVMError(exec, createSyntaxError(exec, ASCIILiteral("invalid getter usage")));
     160        return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid getter usage")));
    161161
    162162    PropertyDescriptor descriptor;
     
    178178    CallData callData;
    179179    if (getCallData(set, callData) == CallTypeNone)
    180         return throwVMError(exec, createSyntaxError(exec, ASCIILiteral("invalid setter usage")));
     180        return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid setter usage")));
    181181
    182182    PropertyDescriptor descriptor;
Note: See TracChangeset for help on using the changeset viewer.