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

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

Issue 1027283004: [es6] do not add caller/arguments to ES6 function definitions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + test262 exceptions Created 5 years, 8 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
Index: test/mjsunit/es6/generators-runtime.js
diff --git a/test/mjsunit/es6/generators-runtime.js b/test/mjsunit/es6/generators-runtime.js
index 88380dfec0b386a50a88d6d55312e3cf821cb5c1..2500e82f71814c41b01fa9f59ba619e2f4d5da8e 100644
--- a/test/mjsunit/es6/generators-runtime.js
+++ b/test/mjsunit/es6/generators-runtime.js
@@ -30,7 +30,7 @@
// See:
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorfunction-objects
-function f() { }
+function f() { "use strict"; }
function* g() { yield 1; }
var GeneratorFunctionPrototype = Object.getPrototypeOf(g);
var GeneratorFunction = GeneratorFunctionPrototype.constructor;
@@ -51,18 +51,16 @@ function TestGeneratorFunctionInstance() {
var prop = f_own_property_names[i];
var f_desc = Object.getOwnPropertyDescriptor(f, prop);
var g_desc = Object.getOwnPropertyDescriptor(g, prop);
- assertEquals(f_desc.configurable, g_desc.configurable, 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);
+ if (prop === "prototype") {
+ // ES6 draft 03-17-2015 section 25.2.2.2
+ assertFalse(g_desc.writable, prop);
+ assertFalse(g_desc.enumerable, prop);
+ assertFalse(g_desc.configurable, prop);
} else {
+ assertEquals(f_desc.configurable, g_desc.configurable, prop);
assertEquals(f_desc.writable, g_desc.writable, prop);
+ assertEquals(f_desc.enumerable, g_desc.enumerable, prop);
}
- assertEquals(f_desc.enumerable, g_desc.enumerable, prop);
}
}
TestGeneratorFunctionInstance();

Powered by Google App Engine
This is Rietveld 408576698