Skip to content
  • barraclough@apple.com's avatar
    putByIndex should throw in strict mode · a4d51f2a
    barraclough@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=80335
    
    Reviewed by Filip Pizlo.
    
    Source/JavaScriptCore: 
    
    We'll need to pass an additional parameter.
    
    Part 1 - rename JSValue::put() for integer indices to JSValue::putByIndex()
    to match the method in the MethodTable, make this take a parameter indicating
    whether the put should throw. This fixes the cases where the base of the put
    is a primitive.
    
    * dfg/DFGOperations.cpp:
    (DFG):
    (JSC::DFG::putByVal):
    (JSC::DFG::operationPutByValInternal):
    * interpreter/Interpreter.cpp:
    (JSC::Interpreter::execute):
    (JSC::Interpreter::privateExecute):
    * jit/JITStubs.cpp:
    (JSC::DEFINE_STUB_FUNCTION):
    * llint/LLIntSlowPaths.cpp:
    (JSC::LLInt::LLINT_SLOW_PATH_DECL):
    * runtime/JSObject.h:
    (JSC::JSValue::putByIndex):
    * runtime/JSValue.cpp:
    (JSC):
    * runtime/JSValue.h:
    (JSValue):
    
    LayoutTests: 
    
    * fast/js/primitive-property-access-edge-cases-expected.txt:
    * fast/js/script-tests/primitive-property-access-edge-cases.js:
    (checkNumericGet.Object.defineProperty):
    (checkNumericSet.Object.defineProperty):
    (checkNumericGetStrict.Object.defineProperty):
    (checkNumericSetStrict.Object.defineProperty):
    (checkNumericRead):
    (checkNumericWrite):
    (checkNumericReadStrict):
    (checkNumericWriteStrict):
        - Added test cases.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a4d51f2a