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

Unified Diff: test/mjsunit/harmony/generators-runtime.js

Issue 270133003: Poison .arguments and .caller for generator functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nits, add tests Created 6 years, 7 months 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
« no previous file with comments | « test/mjsunit/harmony/generators-poisoned-properties.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/generators-runtime.js
diff --git a/test/mjsunit/harmony/generators-runtime.js b/test/mjsunit/harmony/generators-runtime.js
index aef063b6c8298621f2431879695ba895c0561d93..196adff81b0ae586427115496e5c79b01822f513 100644
--- a/test/mjsunit/harmony/generators-runtime.js
+++ b/test/mjsunit/harmony/generators-runtime.js
@@ -55,7 +55,16 @@ function TestGeneratorFunctionInstance() {
var f_desc = Object.getOwnPropertyDescriptor(f, prop);
var g_desc = Object.getOwnPropertyDescriptor(g, prop);
assertEquals(f_desc.configurable, g_desc.configurable, prop);
- assertEquals(f_desc.writable, g_desc.writable, prop);
+ if (prop === 'arguments' || prop === 'caller') {
+ // Unlike sloppy functions, which have read-only data arguments and caller
+ // properties, sloppy generators have a poison pill implemented via
+ // accessors
+ assertFalse('writable' in g_desc, prop);
+ assertTrue(g_desc.get instanceof Function, prop);
+ assertEquals(g_desc.get, g_desc.set, prop);
+ } else {
+ assertEquals(f_desc.writable, g_desc.writable, prop);
+ }
assertEquals(f_desc.enumerable, g_desc.enumerable, prop);
}
}
« no previous file with comments | « test/mjsunit/harmony/generators-poisoned-properties.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698