+2018-01-06 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Object.getOwnPropertyNames includes "arguments" and "caller" for bound functions
+ https://bugs.webkit.org/show_bug.cgi?id=181321
+
+ Reviewed by Saam Barati.
+
+ * stress/bound-function-does-not-have-caller-and-arguments.js: Added.
+ (shouldBe):
+ (testFunction):
+ * test262.yaml:
+
2018-01-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix test262 after r226386.
--- /dev/null
+function shouldBe(actual, expected) {
+ if (actual !== expected)
+ throw new Error('bad value: ' + actual);
+}
+
+function testFunction(func) {
+ var array = Object.getOwnPropertyNames(func);
+ shouldBe(array.indexOf("arguments"), -1);
+ shouldBe(array.indexOf("caller"), -1);
+}
+
+testFunction((() => { }).bind());
+testFunction((() => { "use strict"; }).bind());
+testFunction((function () { }).bind());
+testFunction((function () { "use strict"; }).bind());
- path: test262/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js
cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
- path: test262/test/built-ins/Function/prototype/bind/BoundFunction_restricted-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+ cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
- path: test262/test/built-ins/Function/prototype/bind/BoundFunction_restricted-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+ cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
- path: test262/test/built-ins/Function/prototype/bind/S15.3.4.5_A1.js
cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
- path: test262/test/built-ins/Function/prototype/bind/S15.3.4.5_A1.js
- path: test262/test/language/statements/function/13.2-3-s.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/statements/function/13.2-30-s.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
- path: test262/test/language/statements/function/13.2-30-s.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/statements/function/13.2-4-s.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/statements/function/13.2-5-s.js
+2018-01-06 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Object.getOwnPropertyNames includes "arguments" and "caller" for bound functions
+ https://bugs.webkit.org/show_bug.cgi?id=181321
+
+ Reviewed by Saam Barati.
+
+ * inspector/model/remote-object-get-properties-expected.txt:
+ * inspector/runtime/getProperties-expected.txt:
+ * js/script-tests/strict-throw-type-error.js:
+ * js/strict-throw-type-error-expected.txt:
+
2018-01-05 Youenn Fablet <youenn@apple.com>
Implement Cache API partitioning based on ClientOrigin
OWN PROPERTIES:
name
length
- arguments
- caller
__proto__
targetFunction
boundThis
DISPLAYABLE PROPERTIES:
length
- arguments
- caller
name
+ caller
+ arguments
__proto__
targetFunction
boundThis
ALL PROPERTIES:
length
- arguments
- caller
name
toString
apply
call
bind
+ caller
+ arguments
constructor
Symbol(Symbol.hasInstance)
toLocaleString
__proto__ function function () {
[native code]
}
- arguments getter setter
- caller getter setter
length number 0
name string bound Number
Internal properties:
__proto__ function function () {
[native code]
}
- arguments getter setter
- caller getter setter
length number 0
name string bound
Internal properties:
var functionArguments1 = getter(strictArgumentsFunction1.__proto__, "arguments");
var argumentsCaller1 = Object.getOwnPropertyDescriptor(strictArguments1, "caller");
var argumentsCallee1 = getter(strictArguments1, "callee");
-var boundCaller1 = getter(boundFunction1, "caller");
-var boundArguments1 = getter(boundFunction1, "arguments");
+var boundCaller1 = Object.getOwnPropertyDescriptor(boundFunction1, "caller");
+var boundArguments1 = Object.getOwnPropertyDescriptor(boundFunction1, "arguments");
function strictArgumentsFunction2()
{
var functionArguments2 = getter(strictArgumentsFunction2.__proto__, "arguments");
var argumentsCaller2 = Object.getOwnPropertyDescriptor(strictArguments2, "caller");
var argumentsCallee2 = getter(strictArguments2, "callee");
-var boundCaller2 = getter(boundFunction2, "caller");
-var boundArguments2 = getter(boundFunction2, "arguments");
+var boundCaller2 = Object.getOwnPropertyDescriptor(boundFunction2, "caller");
+var boundArguments2 = Object.getOwnPropertyDescriptor(boundFunction2, "arguments");
shouldBeTrue('functionCaller1 === functionCaller2');
shouldBeTrue('functionCaller1 === functionArguments1');
shouldBe('argumentsCaller1', 'undefined');
shouldBeTrue('functionCaller1 === argumentsCallee1');
-shouldBeTrue('functionCaller1 === boundCaller1');
-shouldBeTrue('functionCaller1 === boundArguments1');
+shouldBe('boundCaller1', 'undefined');
+shouldBe('boundArguments1', 'undefined');
shouldBeTrue('functionCaller2 === functionArguments2');
shouldBe('argumentsCaller2', 'undefined');
shouldBeTrue('functionCaller2 === argumentsCallee2');
-shouldBeTrue('functionCaller2 === boundCaller2');
-shouldBeTrue('functionCaller2 === boundArguments2');
+shouldBe('boundCaller2', 'undefined');
+shouldBe('boundArguments2', 'undefined');
successfullyParsed = true;
PASS functionCaller1 === functionArguments1 is true
PASS argumentsCaller1 is undefined
PASS functionCaller1 === argumentsCallee1 is true
-PASS functionCaller1 === boundCaller1 is true
-PASS functionCaller1 === boundArguments1 is true
+PASS boundCaller1 is undefined
+PASS boundArguments1 is undefined
PASS functionCaller2 === functionArguments2 is true
PASS argumentsCaller2 is undefined
PASS functionCaller2 === argumentsCallee2 is true
-PASS functionCaller2 === boundCaller2 is true
-PASS functionCaller2 === boundArguments2 is true
+PASS boundCaller2 is undefined
+PASS boundArguments2 is undefined
PASS successfullyParsed is true
TEST COMPLETE
+2018-01-06 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Object.getOwnPropertyNames includes "arguments" and "caller" for bound functions
+ https://bugs.webkit.org/show_bug.cgi?id=181321
+
+ Reviewed by Saam Barati.
+
+ According to ECMA262 16.2[1], functions created using the bind method must not have
+ "caller" and "arguments" own properties.
+
+ [1]: https://tc39.github.io/ecma262/#sec-forbidden-extensions
+
+ * runtime/JSBoundFunction.cpp:
+ (JSC::JSBoundFunction::finishCreation):
+
2018-01-05 JF Bastien <jfbastien@apple.com>
WebAssembly: poison JS object's secrets
String name; // We lazily create our 'name' string property.
Base::finishCreation(vm, executable, length, name);
ASSERT(inherits(vm, info()));
-
- putDirectNonIndexAccessor(vm, vm.propertyNames->arguments, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
- putDirectNonIndexAccessor(vm, vm.propertyNames->caller, globalObject()->throwTypeErrorArgumentsCalleeAndCallerGetterSetter(), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
}
void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)