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

Unified Diff: test/mjsunit/es6/iteration-semantics.js

Issue 1417063011: [runtime] support new Proxy() instead of Proxy.create and install getPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unreachable code Created 5 years, 1 month 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/runtime/runtime-proxy.cc ('k') | test/mjsunit/es6/regress/regress-cr493566.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/iteration-semantics.js
diff --git a/test/mjsunit/es6/iteration-semantics.js b/test/mjsunit/es6/iteration-semantics.js
index f29e6e011b5a71deaf00b148dbcd5a53c3f5e426..6466ac5e26cdfcba5f7281fdcb42f6a614faacfa 100644
--- a/test/mjsunit/es6/iteration-semantics.js
+++ b/test/mjsunit/es6/iteration-semantics.js
@@ -307,35 +307,36 @@ assertEquals(5,
try_control(integers_until(10),
function(x) { return (x == 5) ? x : "continue" }));
+// TODO(neis,cbruni): Enable once the corresponding traps work again.
// Proxy results, with getters.
-function transparent_proxy(x) {
- return Proxy.create({
- get: function(receiver, name) { return x[name]; }
- });
-}
-assertEquals([1, 2],
- fold(append, [],
- results([one_time_getter({ value: 1 }, 'done', false),
- one_time_getter({ done: false }, 'value', 2),
- { value: 37, done: true },
- never_getter(never_getter({}, 'done'), 'value')]
- .map(transparent_proxy))));
+// function transparent_proxy(x) {
+// return new Proxy({}, {
+// get: function(receiver, name) { return x[name]; }
+// });
+// }
+// assertEquals([1, 2],
+// fold(append, [],
+// results([one_time_getter({ value: 1 }, 'done', false),
+// one_time_getter({ done: false }, 'value', 2),
+// { value: 37, done: true },
+// never_getter(never_getter({}, 'done'), 'value')]
+// .map(transparent_proxy))));
// Proxy iterators.
-function poison_proxy_after(iterable, n) {
- var iterator = iterable[Symbol.iterator]();
- return wrap_iterator(Proxy.create({
- get: function(receiver, name) {
- if (name == 'next' && n-- < 0) throw "unreachable";
- return iterator[name];
- },
- // Needed for integers_until(10)'s this.n++.
- set: function(receiver, name, val) {
- return iterator[name] = val;
- }
- }));
-}
-assertEquals(45, fold(sum, 0, poison_proxy_after(integers_until(10), 10)));
+// function poison_proxy_after(iterable, n) {
+// var iterator = iterable[Symbol.iterator]();
+// return wrap_iterator(new Proxy({}, {
+// get: function(receiver, name) {
+// if (name == 'next' && n-- < 0) throw "unreachable";
+// return iterator[name];
+// },
+// // Needed for integers_until(10)'s this.n++.
+// set: function(receiver, name, val) {
+// return iterator[name] = val;
+// }
+// }));
+// }
+// assertEquals(45, fold(sum, 0, poison_proxy_after(integers_until(10), 10)));
function test_iterator_result_object_non_object(value, descr) {
« no previous file with comments | « src/runtime/runtime-proxy.cc ('k') | test/mjsunit/es6/regress/regress-cr493566.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698