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

Side by Side Diff: test/mjsunit/regress/regress-5004.js

Issue 2070213002: Promises: Add regression test for promise resolution with proxy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add regression test Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 function assertAsync(b, s) {
8 if (!b) {
9 %AbortJS(" FAILED!")
10 }
11 }
12
13 class P extends Promise {
14 constructor() {
15 super(...arguments)
16 return new Proxy(this, {
17 get: (_, key) => {
18 return key == 'then' ?
19 this.then.bind(this) :
20 this.constructor.resolve(20)
21 }
22 })
23 }
24 }
25
26 let p = P.resolve(10)
27 p.key.then(v => assertAsync(v === 20));
Dan Ehrenberg 2016/06/16 00:38:47 Are you sure this will be enough without %RunMicro
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698