WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Updated patch from comments and rebased failing inspector test
158231-2.patch (text/plain), 43.38 KB, created by
Michael Saboff
on 2016-06-02 13:53:19 PDT
(
hide
)
Description:
Updated patch from comments and rebased failing inspector test
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2016-06-02 13:53:19 PDT
Size:
43.38 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 201608) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,46 @@ >+2016-06-02 Michael Saboff <msaboff@apple.com> >+ >+ REGRESSION(r200694): %ThrowTypeError% is not unique >+ https://bugs.webkit.org/show_bug.cgi?id=158231 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The ES6 standard in section 9.2.7.1 states that %ThrowTypeError% is unique. This >+ change reverts the handling of TypeError before r200694 and then rolls in >+ throwTypeErrorGetterSetter() with the renamed throwTypeErrorArgumentsCalleeAndCallerGetterSetter(). >+ >+ * runtime/ClonedArguments.cpp: >+ (JSC::ClonedArguments::getOwnPropertySlot): >+ (JSC::ClonedArguments::materializeSpecials): >+ * runtime/JSBoundFunction.cpp: >+ (JSC::JSBoundFunction::finishCreation): >+ (JSC::JSBoundFunction::visitChildren): >+ * runtime/JSFunction.cpp: >+ (JSC::getThrowTypeErrorGetterSetter): >+ (JSC::JSFunction::callerGetter): >+ (JSC::JSFunction::defineOwnProperty): >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::regExpProtoSymbolReplaceFunction): >+ (JSC::JSGlobalObject::regExpProtoGlobalGetter): >+ (JSC::JSGlobalObject::regExpProtoUnicodeGetter): >+ (JSC::JSGlobalObject::throwTypeErrorArgumentsCalleeAndCallerGetterSetter): >+ (JSC::JSGlobalObject::moduleLoader): >+ (JSC::JSGlobalObject::throwTypeErrorGetterSetter): Deleted. >+ (JSC::JSGlobalObject::throwTypeErrorCalleeAndCallerGetterSetter): Deleted. >+ (JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter): Deleted. >+ (JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerInClassContextGetterSetter): Deleted. >+ * runtime/JSGlobalObjectFunctions.cpp: >+ (JSC::globalFuncThrowTypeError): >+ (JSC::globalFuncThrowTypeErrorArgumentsCalleeAndCaller): >+ (JSC::globalFuncThrowTypeErrorCalleeAndCaller): Deleted. >+ (JSC::globalFuncThrowTypeErrorArgumentsAndCallerInStrictMode): Deleted. >+ (JSC::globalFuncThrowTypeErrorArgumentsAndCallerInClassContext): Deleted. >+ * runtime/JSGlobalObjectFunctions.h: >+ * tests/stress/reflect-set.js: >+ > 2016-06-02 Filip Pizlo <fpizlo@apple.com> > > Make it easier to use NoLockingNecessary >Index: Source/JavaScriptCore/runtime/ClonedArguments.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/ClonedArguments.cpp (revision 201600) >+++ Source/JavaScriptCore/runtime/ClonedArguments.cpp (working copy) >@@ -158,11 +158,11 @@ bool ClonedArguments::getOwnPropertySlot > > if (isStrictMode) { > if (ident == vm.propertyNames->callee) { >- slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorCalleeAndCallerGetterSetter()); >+ slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter()); > return true; > } > if (ident == vm.propertyNames->caller) { >- slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorCalleeAndCallerGetterSetter()); >+ slot.setGetterSlot(thisObject, DontDelete | DontEnum | Accessor, thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter()); > return true; > } > >@@ -238,8 +238,8 @@ void ClonedArguments::materializeSpecial > bool isStrictMode = executable->isStrictMode(); > > if (isStrictMode) { >- putDirectAccessor(exec, vm.propertyNames->callee, globalObject()->throwTypeErrorCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); >- putDirectAccessor(exec, vm.propertyNames->caller, globalObject()->throwTypeErrorCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); >+ putDirectAccessor(exec, vm.propertyNames->callee, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); >+ putDirectAccessor(exec, vm.propertyNames->caller, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); > } else > putDirect(vm, vm.propertyNames->callee, JSValue(m_callee.get())); > >Index: Source/JavaScriptCore/runtime/JSBoundFunction.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/JSBoundFunction.cpp (revision 201600) >+++ Source/JavaScriptCore/runtime/JSBoundFunction.cpp (working copy) >@@ -196,8 +196,8 @@ void JSBoundFunction::finishCreation(VM& > Base::finishCreation(vm, executable, length, name); > ASSERT(inherits(info())); > >- putDirectNonIndexAccessor(vm, vm.propertyNames->arguments, globalObject()->throwTypeErrorGetterSetter(), DontDelete | DontEnum | Accessor); >- putDirectNonIndexAccessor(vm, vm.propertyNames->caller, globalObject()->throwTypeErrorGetterSetter(), DontDelete | DontEnum | Accessor); >+ putDirectNonIndexAccessor(vm, vm.propertyNames->arguments, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); >+ putDirectNonIndexAccessor(vm, vm.propertyNames->caller, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); > } > > void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor) >Index: Source/JavaScriptCore/runtime/JSFunction.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/JSFunction.cpp (revision 201600) >+++ Source/JavaScriptCore/runtime/JSFunction.cpp (working copy) >@@ -319,13 +319,6 @@ static JSValue retrieveCallerFunction(Ex > return functor.result(); > } > >-static GetterSetter* getThrowTypeErrorGetterSetter(JSFunction* function) >-{ >- return function->jsExecutable()->isClassConstructorFunction() || function->jsExecutable()->parseMode() == SourceParseMode::MethodMode >- ? function->globalObject()->throwTypeErrorArgumentsAndCallerInClassContextGetterSetter() >- : function->globalObject()->throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter(); >-} >- > EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) > { > JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(thisValue)); >@@ -375,7 +368,7 @@ bool JSFunction::getOwnPropertySlot(JSOb > if (thisObject->jsExecutable()->isStrictMode() || thisObject->jsExecutable()->isClassConstructorFunction()) { > bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); > if (!result) { >- GetterSetter* errorGetterSetter = getThrowTypeErrorGetterSetter(thisObject); >+ GetterSetter* errorGetterSetter = thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(); > thisObject->putDirectAccessor(exec, propertyName, errorGetterSetter, DontDelete | DontEnum | Accessor); > result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); > ASSERT(result); >@@ -390,7 +383,7 @@ bool JSFunction::getOwnPropertySlot(JSOb > if (thisObject->jsExecutable()->isStrictMode() || thisObject->jsExecutable()->isClassConstructorFunction()) { > bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); > if (!result) { >- GetterSetter* errorGetterSetter = getThrowTypeErrorGetterSetter(thisObject); >+ GetterSetter* errorGetterSetter = thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(); > thisObject->putDirectAccessor(exec, propertyName, errorGetterSetter, DontDelete | DontEnum | Accessor); > result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); > ASSERT(result); >@@ -499,7 +492,7 @@ bool JSFunction::defineOwnProperty(JSObj > if (thisObject->jsExecutable()->isStrictMode()) { > PropertySlot slot(thisObject, PropertySlot::InternalMethodType::VMInquiry); > if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) >- thisObject->putDirectAccessor(exec, propertyName, getThrowTypeErrorGetterSetter(thisObject), DontDelete | DontEnum | Accessor); >+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); > return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); > } > valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), retrieveArguments(exec, thisObject)); >@@ -507,7 +500,7 @@ bool JSFunction::defineOwnProperty(JSObj > if (thisObject->jsExecutable()->isStrictMode()) { > PropertySlot slot(thisObject, PropertySlot::InternalMethodType::VMInquiry); > if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) >- thisObject->putDirectAccessor(exec, propertyName, getThrowTypeErrorGetterSetter(thisObject), DontDelete | DontEnum | Accessor); >+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), DontDelete | DontEnum | Accessor); > return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); > } > valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), retrieveCallerFunction(exec, thisObject)); >Index: Source/JavaScriptCore/runtime/JSGlobalObject.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/JSGlobalObject.cpp (revision 201600) >+++ Source/JavaScriptCore/runtime/JSGlobalObject.cpp (working copy) >@@ -384,25 +384,9 @@ void JSGlobalObject::init(VM& vm) > getterSetter->setSetter(init.vm, init.owner, thrower); > init.set(getterSetter); > }); >- m_throwTypeErrorCalleeAndCallerGetterSetter.initLater( >+ m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter.initLater( > [] (const Initializer<GetterSetter>& init) { >- JSFunction* thrower = JSFunction::create(init.vm, init.owner, 0, String(), globalFuncThrowTypeErrorCalleeAndCaller); >- GetterSetter* getterSetter = GetterSetter::create(init.vm, init.owner); >- getterSetter->setGetter(init.vm, init.owner, thrower); >- getterSetter->setSetter(init.vm, init.owner, thrower); >- init.set(getterSetter); >- }); >- m_throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter.initLater( >- [] (const Initializer<GetterSetter>& init) { >- JSFunction* thrower = JSFunction::create(init.vm, init.owner, 0, String(), globalFuncThrowTypeErrorArgumentsAndCallerInStrictMode); >- GetterSetter* getterSetter = GetterSetter::create(init.vm, init.owner); >- getterSetter->setGetter(init.vm, init.owner, thrower); >- getterSetter->setSetter(init.vm, init.owner, thrower); >- init.set(getterSetter); >- }); >- m_throwTypeErrorArgumentsAndCallerInClassContextGetterSetter.initLater( >- [] (const Initializer<GetterSetter>& init) { >- JSFunction* thrower = JSFunction::create(init.vm, init.owner, 0, String(), globalFuncThrowTypeErrorArgumentsAndCallerInClassContext); >+ JSFunction* thrower = JSFunction::create(init.vm, init.owner, 0, String(), globalFuncThrowTypeErrorArgumentsCalleeAndCaller); > GetterSetter* getterSetter = GetterSetter::create(init.vm, init.owner); > getterSetter->setGetter(init.vm, init.owner, thrower); > getterSetter->setSetter(init.vm, init.owner, thrower); >@@ -1074,9 +1058,7 @@ void JSGlobalObject::visitChildren(JSCel > visitor.append(&thisObject->m_newPromiseCapabilityFunction); > visitor.append(&thisObject->m_functionProtoHasInstanceSymbolFunction); > thisObject->m_throwTypeErrorGetterSetter.visit(visitor); >- thisObject->m_throwTypeErrorCalleeAndCallerGetterSetter.visit(visitor); >- thisObject->m_throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter.visit(visitor); >- thisObject->m_throwTypeErrorArgumentsAndCallerInClassContextGetterSetter.visit(visitor); >+ thisObject->m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter.visit(visitor); > visitor.append(&thisObject->m_moduleLoader); > > visitor.append(&thisObject->m_objectPrototype); >Index: Source/JavaScriptCore/runtime/JSGlobalObject.h >=================================================================== >--- Source/JavaScriptCore/runtime/JSGlobalObject.h (revision 201600) >+++ Source/JavaScriptCore/runtime/JSGlobalObject.h (working copy) >@@ -242,14 +242,12 @@ public: > LazyProperty<JSGlobalObject, JSFunction> m_initializePromiseFunction; > WriteBarrier<JSFunction> m_newPromiseCapabilityFunction; > WriteBarrier<JSFunction> m_functionProtoHasInstanceSymbolFunction; >+ LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorGetterSetter; > WriteBarrier<JSObject> m_regExpProtoExec; > WriteBarrier<JSObject> m_regExpProtoSymbolReplace; > WriteBarrier<JSObject> m_regExpProtoGlobalGetter; > WriteBarrier<JSObject> m_regExpProtoUnicodeGetter; >- LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorGetterSetter; >- LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorCalleeAndCallerGetterSetter; >- LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter; >- LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorArgumentsAndCallerInClassContextGetterSetter; >+ LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter; > > WriteBarrier<ModuleLoaderObject> m_moduleLoader; > >@@ -490,11 +488,10 @@ public: > JSObject* regExpProtoSymbolReplaceFunction() const { return m_regExpProtoSymbolReplace.get(); } > JSObject* regExpProtoGlobalGetter() const { return m_regExpProtoGlobalGetter.get(); } > JSObject* regExpProtoUnicodeGetter() const { return m_regExpProtoUnicodeGetter.get(); } >- >- GetterSetter* throwTypeErrorGetterSetter() { return m_throwTypeErrorGetterSetter.get(this); } >- GetterSetter* throwTypeErrorCalleeAndCallerGetterSetter() { return m_throwTypeErrorCalleeAndCallerGetterSetter.get(this); } >- GetterSetter* throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter() { return m_throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter.get(this); } >- GetterSetter* throwTypeErrorArgumentsAndCallerInClassContextGetterSetter() { return m_throwTypeErrorArgumentsAndCallerInClassContextGetterSetter.get(this); } >+ GetterSetter* throwTypeErrorArgumentsCalleeAndCallerGetterSetter() >+ { >+ return m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter.get(this); >+ } > > ModuleLoaderObject* moduleLoader() const { return m_moduleLoader.get(); } > >Index: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (revision 201600) >+++ Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (working copy) >@@ -781,20 +781,10 @@ EncodedJSValue JSC_HOST_CALL globalFuncT > { > return throwVMTypeError(exec); > } >- >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorCalleeAndCaller(ExecState* exec) >-{ >- return throwVMTypeError(exec, "'callee' and 'caller' cannot be accessed in strict mode."); >-} >- >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsAndCallerInStrictMode(ExecState* exec) >-{ >- return throwVMTypeError(exec, "'caller' and 'arguments' cannot be accessed in strict mode."); >-} >- >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsAndCallerInClassContext(ExecState* exec) >+ >+EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsCalleeAndCaller(ExecState* exec) > { >- return throwVMTypeError(exec, "'caller' and 'arguments' cannot be accessed in class context."); >+ return throwVMTypeError(exec, "'arguments', 'callee', and 'caller' cannot be accessed in strict mode."); > } > > class GlobalFuncProtoGetterFunctor { >Index: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h >=================================================================== >--- Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h (revision 201600) >+++ Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h (working copy) >@@ -49,9 +49,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncE > EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState*); > EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState*); > EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeError(ExecState*); >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorCalleeAndCaller(ExecState*); >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsAndCallerInStrictMode(ExecState*); >-EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsAndCallerInClassContext(ExecState*); >+EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsCalleeAndCaller(ExecState*); > EncodedJSValue JSC_HOST_CALL globalFuncProtoGetter(ExecState*); > EncodedJSValue JSC_HOST_CALL globalFuncProtoSetter(ExecState*); > EncodedJSValue JSC_HOST_CALL globalFuncBuiltinLog(ExecState*); >Index: Source/JavaScriptCore/tests/stress/reflect-set.js >=================================================================== >--- Source/JavaScriptCore/tests/stress/reflect-set.js (revision 201600) >+++ Source/JavaScriptCore/tests/stress/reflect-set.js (working copy) >@@ -877,10 +877,10 @@ var symbol = Symbol(); > > shouldThrow(() => { > Reflect.set(object, 'callee', 'Cappuccino'); >- }, `TypeError: 'callee' and 'caller' cannot be accessed in strict mode.`); >+ }, `TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.`); > shouldThrow(() => { > Reflect.get(object, 'callee'); >- }, `TypeError: 'callee' and 'caller' cannot be accessed in strict mode.`); >+ }, `TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.`); > } > > function test4() { >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 201600) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,36 @@ >+2016-06-02 Michael Saboff <msaboff@apple.com> >+ >+ REGRESSION(r200694): %ThrowTypeError% is not unique >+ https://bugs.webkit.org/show_bug.cgi?id=158231 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rebased tests for the new TypeError messages. >+ Added a new test, throw-type-error-is-unique.html. >+ >+ * inspector/runtime/getProperties-expected.txt >+ * js/basic-strict-mode-expected.txt: >+ * js/caller-property-expected.txt: >+ * js/class-method-and-constructor-properties-expected.txt: >+ * js/script-tests/caller-property.js: >+ (strictCaller): >+ (strictTailCaller): >+ * js/script-tests/class-method-and-constructor-properties.js: >+ (F.prototype.getElement): >+ (F): >+ (G.prototype.get item): >+ (G): >+ (H.prototype.arguments): >+ (H): >+ * js/script-tests/throw-type-error-is-unique.js: Added. >+ (ThrowTypeErrorSource): >+ (ThrowTypeErrorSource.prototype.checkTypeErrorFunctions): >+ (A): >+ (strictArguments): >+ (test): >+ * js/throw-type-error-is-unique-expected.txt: Added. >+ * js/throw-type-error-is-unique.html: Added. >+ > 2016-06-02 Per Arne Vollan <pvollan@apple.com> > > Unreviewed test gardening. >Index: LayoutTests/inspector/runtime/getProperties-expected.txt >=================================================================== >--- LayoutTests/inspector/runtime/getProperties-expected.txt (revision 201600) >+++ LayoutTests/inspector/runtime/getProperties-expected.txt (working copy) >@@ -21,8 +21,8 @@ Properties: > __proto__ function function () { > [native code] > } >- arguments object TypeError: Type error >- caller object TypeError: Type error >+ arguments object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+ caller object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. > length number 0 > name string bound Number > Internal properties: >@@ -38,8 +38,8 @@ Properties: > __proto__ function function () { > [native code] > } >- arguments object TypeError: Type error >- caller object TypeError: Type error >+ arguments object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+ caller object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. > length number 0 > name string bound > Internal properties: >Index: LayoutTests/js/basic-strict-mode-expected.txt >=================================================================== >--- LayoutTests/js/basic-strict-mode-expected.txt (revision 201600) >+++ LayoutTests/js/basic-strict-mode-expected.txt (working copy) >@@ -56,18 +56,18 @@ PASS (function (){var a; function f() {' > PASS (function(){(function (){var a; function f() {'use strict'; delete a;} })()}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.. > PASS (function (){'use strict'; with(1){};}) threw exception SyntaxError: 'with' statements are not valid in strict mode.. > PASS (function(){(function (){'use strict'; with(1){};})}) threw exception SyntaxError: 'with' statements are not valid in strict mode.. >-PASS (function (){'use strict'; arguments.callee; })() threw exception TypeError: 'callee' and 'caller' cannot be accessed in strict mode.. >-PASS (function (){'use strict'; arguments.caller; })() threw exception TypeError: 'callee' and 'caller' cannot be accessed in strict mode.. >-PASS (function f(){'use strict'; f.arguments; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(){'use strict'; f.caller; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(){'use strict'; f.arguments=5; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(){'use strict'; f.caller=5; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function (arg){'use strict'; arguments.callee; })() threw exception TypeError: 'callee' and 'caller' cannot be accessed in strict mode.. >-PASS (function (arg){'use strict'; arguments.caller; })() threw exception TypeError: 'callee' and 'caller' cannot be accessed in strict mode.. >-PASS (function f(arg){'use strict'; f.arguments; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(arg){'use strict'; f.caller; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(arg){'use strict'; f.arguments=5; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS (function f(arg){'use strict'; f.caller=5; })() threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS (function (){'use strict'; arguments.callee; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function (){'use strict'; arguments.caller; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(){'use strict'; f.arguments; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(){'use strict'; f.caller; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(){'use strict'; f.arguments=5; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(){'use strict'; f.caller=5; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function (arg){'use strict'; arguments.callee; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function (arg){'use strict'; arguments.caller; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(arg){'use strict'; f.arguments; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(arg){'use strict'; f.caller; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(arg){'use strict'; f.arguments=5; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS (function f(arg){'use strict'; f.caller=5; })() threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS "caller" in function(){"use strict"} is true > PASS (function(){"use strict";}).hasOwnProperty("caller") is true > PASS "arguments" in function(){"use strict"} is true >Index: LayoutTests/js/caller-property-expected.txt >=================================================================== >--- LayoutTests/js/caller-property-expected.txt (revision 201600) >+++ LayoutTests/js/caller-property-expected.txt (working copy) >@@ -7,25 +7,25 @@ PASS childHasCallerWhenExecutingGlobalCo > PASS childHasCallerWhenCalledWithoutParent is false > PASS childHasCallerWhenCalledFromWithinParent is true > PASS nonStrictCaller(nonStrictCallee) is nonStrictCaller >-PASS nonStrictCaller(strictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS nonStrictCaller(strictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS strictCaller(nonStrictCallee) threw exception TypeError: Function.caller used to retrieve strict caller. >-PASS strictCaller(strictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS strictCaller(strictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS strictTailCaller(nonStrictCallee) is null >-PASS strictTailCaller(strictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS strictTailCaller(strictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS nonStrictCaller(boundNonStrictCallee) is nonStrictCaller >-PASS nonStrictCaller(boundStrictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS nonStrictCaller(boundStrictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS strictCaller(boundNonStrictCallee) threw exception TypeError: Function.caller used to retrieve strict caller. >-PASS strictCaller(boundStrictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS strictCaller(boundStrictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS strictTailCaller(boundNonStrictCallee) is null >-PASS strictTailCaller(boundStrictCallee) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS strictTailCaller(boundStrictCallee) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS nonStrictGetter(nonStrictAccessor) is nonStrictGetter > PASS nonStrictSetter(nonStrictAccessor) is true >-PASS nonStrictGetter(strictAccessor) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS nonStrictSetter(strictAccessor) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS nonStrictGetter(strictAccessor) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS nonStrictSetter(strictAccessor) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS strictGetter(nonStrictAccessor) threw exception TypeError: Function.caller used to retrieve strict caller. > PASS strictSetter(nonStrictAccessor) threw exception TypeError: Function.caller used to retrieve strict caller. >-PASS strictGetter(strictAccessor) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >-PASS strictSetter(strictAccessor) threw exception TypeError: 'caller' and 'arguments' cannot be accessed in strict mode.. >+PASS strictGetter(strictAccessor) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. >+PASS strictSetter(strictAccessor) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.. > PASS successfullyParsed is true > > TEST COMPLETE >Index: LayoutTests/js/class-method-and-constructor-properties-expected.txt >=================================================================== >--- LayoutTests/js/class-method-and-constructor-properties-expected.txt (revision 201600) >+++ LayoutTests/js/class-method-and-constructor-properties-expected.txt (working copy) >@@ -3,28 +3,28 @@ Tests for ES6 class method and construct > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS (new A()).constructor.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new A()).constructor.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new B()).constructor.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new B()).constructor.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new C()).constructor.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new C()).constructor.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new D()).constructor.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new D()).constructor.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new E()).getItem.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new E()).getItem.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new F()).getItem.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new F()).getItem.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new F()).getElement.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new F()).getElement.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >+PASS (new A()).constructor.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new A()).constructor.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new B()).constructor.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new B()).constructor.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new C()).constructor.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new C()).constructor.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new D()).constructor.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new D()).constructor.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new E()).getItem.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new E()).getItem.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new F()).getItem.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new F()).getItem.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new F()).getElement.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new F()).getElement.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. > PASS (new G()).item.caller:::undefined > PASS (new G()).item.arguments:::undefined >-PASS H.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS H.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >+PASS H.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS H.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. > PASS (new H()).caller():::"value" > PASS (new H()).arguments():::"value" >-PASS (new H()).caller.caller:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >-PASS (new H()).caller.arguments:::TypeError: 'caller' and 'arguments' cannot be accessed in class context. >+PASS (new H()).caller.caller:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. >+PASS (new H()).caller.arguments:::TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode. > PASS successfullyParsed:::true > > TEST COMPLETE >Index: LayoutTests/js/throw-type-error-is-unique-expected.txt >=================================================================== >--- LayoutTests/js/throw-type-error-is-unique-expected.txt (revision 0) >+++ LayoutTests/js/throw-type-error-is-unique-expected.txt (working copy) >@@ -0,0 +1,10 @@ >+Tests ES6 %ThrowTypeError% intrinsic is unique >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS %ThrowTypeError% intrinsic is unique >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/js/throw-type-error-is-unique.html >=================================================================== >--- LayoutTests/js/throw-type-error-is-unique.html (revision 0) >+++ LayoutTests/js/throw-type-error-is-unique.html (working copy) >@@ -0,0 +1,10 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/throw-type-error-is-unique.js"></script> >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/js/script-tests/caller-property.js >=================================================================== >--- LayoutTests/js/script-tests/caller-property.js (revision 201600) >+++ LayoutTests/js/script-tests/caller-property.js (working copy) >@@ -27,9 +27,9 @@ function nonStrictCaller(x) { return x() > function strictCaller(x) { "use strict"; var result = x(); return result; } > function strictTailCaller(x) { "use strict"; return x(); } > shouldBe("nonStrictCaller(nonStrictCallee)", "nonStrictCaller"); >-shouldThrow("nonStrictCaller(strictCallee)"); >-shouldThrow("strictCaller(nonStrictCallee)", '"TypeError: Function.caller used to retrieve strict caller"'); >-shouldThrow("strictCaller(strictCallee)"); >+shouldThrow("nonStrictCaller(strictCallee)", '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow("strictCaller(nonStrictCallee)"); >+shouldThrow("strictCaller(strictCallee)", '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); > shouldBe("strictTailCaller(nonStrictCallee)", "null"); > shouldThrow("strictTailCaller(strictCallee)"); > >Index: LayoutTests/js/script-tests/class-method-and-constructor-properties.js >=================================================================== >--- LayoutTests/js/script-tests/class-method-and-constructor-properties.js (revision 201600) >+++ LayoutTests/js/script-tests/class-method-and-constructor-properties.js (working copy) >@@ -33,20 +33,20 @@ class E { getItem() { return 'text';} } > class F extends E { getElement() { return 'text'}} > class G extends E { get item() { return 'text'} } > >-shouldThrow('(new A()).constructor.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new A()).constructor.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new B()).constructor.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new B()).constructor.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new C()).constructor.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new C()).constructor.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new D()).constructor.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new D()).constructor.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new E()).getItem.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new E()).getItem.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new F()).getItem.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new F()).getItem.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new F()).getElement.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new F()).getElement.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >+shouldThrow('(new A()).constructor.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new A()).constructor.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new B()).constructor.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new B()).constructor.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new C()).constructor.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new C()).constructor.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new D()).constructor.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new D()).constructor.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new E()).getItem.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new E()).getItem.arguments', ''); >+shouldThrow('(new F()).getItem.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new F()).getItem.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new F()).getElement.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new F()).getElement.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); > > shouldBe('(new G()).item.caller', 'undefined'); > shouldBe('(new G()).item.arguments', 'undefined'); >@@ -56,14 +56,14 @@ class H { > arguments() { return 'value'; } > } > >-shouldThrow('H.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('H.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >+shouldThrow('H.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('H.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); > > shouldBe('(new H()).caller()', '"value"'); > shouldBe('(new H()).arguments()', '"value"'); > >-shouldThrow('(new H()).caller.caller', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >-shouldThrow('(new H()).caller.arguments', '"TypeError: \'caller\' and \'arguments\' cannot be accessed in class context."'); >+shouldThrow('(new H()).caller.caller', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); >+shouldThrow('(new H()).caller.arguments', '"TypeError: \'arguments\', \'callee\', and \'caller\' cannot be accessed in strict mode."'); > > > var successfullyParsed = true; >Index: LayoutTests/js/script-tests/throw-type-error-is-unique.js >=================================================================== >--- LayoutTests/js/script-tests/throw-type-error-is-unique.js (revision 0) >+++ LayoutTests/js/script-tests/throw-type-error-is-unique.js (working copy) >@@ -0,0 +1,68 @@ >+"use strict"; >+ >+description('Tests ES6 %ThrowTypeError% intrinsic is unique'); >+ >+class ThrowTypeErrorSource { >+ constructor(context, base, names) >+ { >+ this.context = context; >+ this.base = base; >+ this.names = names; >+ } >+ >+ checkTypeErrorFunctions(throwTypeErrorFunction) >+ { >+ let errors = 0; >+ for (let name of this.names) { >+ let desc = Object.getOwnPropertyDescriptor(this.base, name); >+ >+ if (!desc) >+ return 0; >+ >+ for (let accessorType of ["get", "set"]) { >+ let accessor = desc[accessorType]; >+ if (accessor && accessor !== throwTypeErrorFunction) { >+ testFailed(this.context + " " + accessorType + "ter for \"" + name + "\" is not the same %ThrowTypeError% intrinsic"); >+ errors++; >+ } >+ } >+ } >+ >+ return errors; >+ } >+} >+ >+class A { }; >+let arrayProtoPush = Array.prototype.push; >+ >+function strictArguments() >+{ >+ return arguments; >+} >+ >+let sloppyArguments = Function("return arguments;"); >+ >+function test() >+{ >+ let baseThrowTypeErrorFunction = Object.getOwnPropertyDescriptor(arguments, "caller").get; >+ >+ let sources = [ >+ new ThrowTypeErrorSource("Function.prototype", Function.prototype, ["arguments", "caller"]), >+ new ThrowTypeErrorSource("Array.prototype.push (builtin)", arrayProtoPush, ["arguments", "caller"]), >+ new ThrowTypeErrorSource("Strict function arguments", strictArguments, ["arguments", "caller"]), >+ new ThrowTypeErrorSource("Sloppy function arguments", sloppyArguments, ["arguments", "caller"]), >+ new ThrowTypeErrorSource("Strict arguments", strictArguments(), ["callee", "caller"]), >+ new ThrowTypeErrorSource("Sloppy arguments", sloppyArguments(), ["callee", "caller"]), >+ new ThrowTypeErrorSource("Class constructor", (new A()).constructor, ["arguments", "caller"]) >+ ]; >+ >+ let errors = 0; >+ >+ for (let source of sources) >+ errors += source.checkTypeErrorFunctions(baseThrowTypeErrorFunction); >+ >+ if (!errors) >+ testPassed("%ThrowTypeError% intrinsic is unique"); >+} >+ >+test();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
joepeck
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 158231
:
280347
|
280355
|
280356
|
280358
| 280363