From b548ce1e246176ca27560b2f7f1524e86fd3679a Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Mon, 8 May 2017 23:10:06 -0700 Subject: [PATCH] Encode IteratorPrototypes as Intrinsic Names Kind of abusing the intrinsic string name here but that's ok. --- src/intrinsics/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/intrinsics/index.js b/src/intrinsics/index.js index e2e8d97ef4..bcd85aeaa9 100644 --- a/src/intrinsics/index.js +++ b/src/intrinsics/index.js @@ -239,11 +239,11 @@ export function initialize(i: Intrinsics, realm: Realm): Intrinsics { i.Uint32ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, "Uint32Array.prototype"); // iterator prototypes - i.IteratorPrototype = new ObjectValue(realm, i.ObjectPrototype, "IteratorPrototype"); - i.MapIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "MapIteratorPrototype"); - i.SetIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "SetIteratorPrototype"); - i.ArrayIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "ArrayIteratorPrototype"); - i.StringIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "StringIteratorPrototype"); + i.IteratorPrototype = new ObjectValue(realm, i.ObjectPrototype, "([][Symbol.iterator]().__proto__.__proto__)"); + i.MapIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "(new Map()[Symbol.iterator]().__proto__)"); + i.SetIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "(new Set()[Symbol.iterator]().__proto__)"); + i.ArrayIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "([][Symbol.iterator]().__proto__)"); + i.StringIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, "(\"\"[Symbol.iterator]().__proto__)"); // initializeObjectPrototype(realm, i.ObjectPrototype);