Reviewers: adamk,
Message:
PTAL
Description:
Bound functions should also have configurable length
BUG=v8:4116
LOG=N
[email protected]
Please review this at https://codereview.chromium.org/1180873002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+13, -3 lines):
M src/runtime/runtime-function.cc
M test/mjsunit/regress/regress-1419.js
M test/test262-es6/test262-es6.status
M test/test262/test262.status
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc
b/src/runtime/runtime-function.cc
index
b0c75bc56a03154ab16c7490cb985ee34271d332..6283f1ee800c8cd2cbda1e6907ca92e2facb96b2
100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -446,7 +446,7 @@ RUNTIME_FUNCTION(Runtime_FunctionBindArguments) {
JSObject::MigrateToMap(bound_function, bound_function_map);
Handle<String> length_string = isolate->factory()->length_string();
PropertyAttributes attr =
- static_cast<PropertyAttributes>(DONT_DELETE | DONT_ENUM | READ_ONLY);
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
RETURN_FAILURE_ON_EXCEPTION(
isolate, JSObject::SetOwnPropertyIgnoreAttributes(
bound_function, length_string, new_length, attr));
Index: test/mjsunit/regress/regress-1419.js
diff --git a/test/mjsunit/regress/regress-1419.js
b/test/mjsunit/regress/regress-1419.js
index
98a8b76b57939d96feae52e69656c0bf4a992f0e..55bcd7ccaa0eb88248013819c2df81d04146bffe
100644
--- a/test/mjsunit/regress/regress-1419.js
+++ b/test/mjsunit/regress/regress-1419.js
@@ -44,4 +44,12 @@ assertEquals(1, f1.length);
var desc = Object.getOwnPropertyDescriptor(f1, 'length');
assertEquals(false, desc.writable);
assertEquals(false, desc.enumerable);
-assertEquals(false, desc.configurable);
+assertEquals(true, desc.configurable);
+
+Object.defineProperty(f1, 'length', {
+ value: 'abc',
+ writable: true
+});
+assertEquals('abc', f1.length);
+f1.length = 42;
+assertEquals(42, f1.length);
Index: test/test262-es6/test262-es6.status
diff --git a/test/test262-es6/test262-es6.status
b/test/test262-es6/test262-es6.status
index
d003467ed93ade188e62b4b81df912701806c853..bac17e7e58e84e6843f9c5ccd3d341fe79041936
100644
--- a/test/test262-es6/test262-es6.status
+++ b/test/test262-es6/test262-es6.status
@@ -626,8 +626,9 @@
'built-ins/Function/prototype/bind/15.3.4.5-21-4': [FAIL_OK],
'built-ins/Function/prototype/bind/15.3.4.5-21-5': [FAIL_OK],
- # This invalid test has been fixed upstream.
+ # These invalid tests have been fixed upstream.
'built-ins/Array/prototype/find/Array.prototype.find_remove-after-start':
[FAIL],
+ 'built-ins/Function/prototype/bind/15.3.4.5-15-2': [FAIL],
############################ SKIPPED TESTS #############################
Index: test/test262/test262.status
diff --git a/test/test262/test262.status b/test/test262/test262.status
index
bfaa7d383136ef207d4660511c528fa299a7f3d4..202add9d081367e66c93de1435eba08449943db6
100644
--- a/test/test262/test262.status
+++ b/test/test262/test262.status
@@ -229,6 +229,7 @@
'S15.9.5.7_A3_T2': [FAIL],
'S15.9.5.8_A3_T2': [FAIL],
'S15.9.5.9_A3_T2': [FAIL],
+ '15.3.4.5-15-2': [FAIL],
# Object.getPrototypeOf wraps primitive values in ES6.
'15.2.3.2-1': [FAIL],
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.