Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: test/mjsunit/regress/regress-1530.js

Issue 99203006: Make a strict function's "name" property non-writable. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Make Function.name [[Configurable]] per ES6 Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/regress/regress-1530.js
diff --git a/test/mjsunit/regress/regress-1530.js b/test/mjsunit/regress/regress-1530.js
index db2114450e4133371bc9045e0c409f5154333d01..a9bd9cf27ef920e419e0d96ade2286be86b804d9 100644
--- a/test/mjsunit/regress/regress-1530.js
+++ b/test/mjsunit/regress/regress-1530.js
@@ -62,8 +62,17 @@ assertSame(new f().foo, 'other');
assertSame(Object.getPrototypeOf(new f()), z);
assertSame(Object.getOwnPropertyDescriptor(f, 'prototype').value, z);
+// Verify that "name" is (initially) non-writable, but configurable.
+var fname = f.name;
+f.name = z;
+assertSame(fname, f.name);
+// Have to make "name"'s property descriptor explicitly writable
+// to alter its value in one go..shouldn't have to. Bug or grey
+// area of accessor resolution semantics?
+Object.defineProperty(f, 'name', { value: 'other', writable: true });
+assertSame('other', f.name);
+
// Verify that non-writability of other properties is respected.
-assertThrows("Object.defineProperty(f, 'name', { value: {} })");
assertThrows("Object.defineProperty(f, 'length', { value: {} })");
assertThrows("Object.defineProperty(f, 'caller', { value: {} })");
assertThrows("Object.defineProperty(f, 'arguments', { value: {} })");

Powered by Google App Engine
This is Rietveld 408576698