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

Unified Diff: test/mjsunit/builtins.js

Issue 1062633002: Re-implement %Generator% intrinsic as an object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO contact and bug URL 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
« no previous file with comments | « src/generator.js ('k') | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/builtins.js
diff --git a/test/mjsunit/builtins.js b/test/mjsunit/builtins.js
index fe7d35d8ea160fc447fe187980488f27a1581bbf..5035e67309be8c762f8c47e3139e8ab942029f73 100644
--- a/test/mjsunit/builtins.js
+++ b/test/mjsunit/builtins.js
@@ -39,12 +39,26 @@ function isFunction(obj) {
}
function isV8Native(name) {
- return name == "GeneratorFunctionPrototype" ||
+ return name == "GeneratorFunction" ||
+ name == "GeneratorFunctionPrototype" ||
name == "SetIterator" ||
name == "MapIterator" ||
name == "ArrayIterator" ||
name == "StringIterator";
}
+var V8NativePrototypes = {
+ GeneratorFunction: Function.prototype,
+ // TODO(jugglinmike): Update the following values to the %IteratorPrototype%
+ // intrinsic once it is implemented.
+ // Issue 3568: Generator Prototype should have an object between itself
+ // and Object.prototype
+ // https://code.google.com/p/v8/issues/detail?id=3568
+ GeneratorFunctionPrototype: Object.prototype,
+ SetIterator: Object.prototype,
+ MapIterator: Object.prototype,
+ ArrayIterator: Object.prototype,
+ StringIterator: Object.prototype
+};
function checkConstructor(func, name) {
// A constructor is a function with a prototype and properties on the
@@ -62,7 +76,7 @@ function checkConstructor(func, name) {
assertFalse(proto_desc.writable, name);
assertFalse(proto_desc.configurable, name);
var prototype = proto_desc.value;
- assertEquals(isV8Native(name) ? Object.prototype : null,
+ assertEquals(V8NativePrototypes[name] || null,
Object.getPrototypeOf(prototype),
name);
for (var i = 0; i < propNames.length; i++) {
« no previous file with comments | « src/generator.js ('k') | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698