Commit 3624a5e1 authored by gsathya's avatar gsathya Committed by Commit bot

Promises: Add regression test for promise resolution with proxy

BUG=v8:5004

Review-Url: https://codereview.chromium.org/2070213002
Cr-Commit-Position: refs/heads/master@{#37015}
parent c304d414
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function assertAsync(b, s) {
if (!b) {
%AbortJS(" FAILED!")
}
}
class P extends Promise {
constructor() {
super(...arguments)
return new Proxy(this, {
get: (_, key) => {
return key == 'then' ?
this.then.bind(this) :
this.constructor.resolve(20)
}
})
}
}
let p = P.resolve(10)
p.key.then(v => assertAsync(v === 20));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment