Possible Promise<Proxy> bug

node v8.17.0
version: 2.0.0
endpointsharetweet
// Construct a proxy handler with noop getter and setter const handler = { get (target, name) { console.error('Getter ' + name + ' should not be called') }, set (target, name, value) { console.error('Setter ' + name + ' should not be called') } } // Create a proxy using the handler const proxy = new Proxy({}, handler) // Resolve a promise with the new proxy const promise = new Promise((resolve, reject) => { resolve(proxy) }) // Access the proxy from the promise, and the getter for 'then' on the proxy // is called, not the 'then' method on the promise as expected promise.then((proxy) => proxy)
Loading…

no comments

    sign in to comment