Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Boris Zbarsky
On 1/10/17 2:54 PM, Michał Wadas wrote: Internal slots correspond to internal state that is associated with objects and used by various ECMAScript specification algorithms. *Internal slots are not object properties* and they are not inherited. OK, so having an internal slot for the value of .st

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Allen Wirfs-Brock
> On Jan 10, 2017, at 9:57 AM, Boris Zbarsky wrote: > > On 1/10/17 1:56 AM, Raul-Sebastian Mihăilă wrote: >> Even if the `stack` property is non-standard, getting its property >> descriptor must follow the same general rules for ordinary objects. > > Not if its (non-standard) implementation mak

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Michał Wadas
V8 have bug. Reproduction code: Error.prepareStackTrace = ()=>{throw 123} Object.getOwnPropertyDescriptor(new Error, 'stack') // throws 123 It should be probably filled on V8 bug tracker. On 10/01/17 21:14, Isiah Meadows wrote: > > To clarify, what engine has the bug here? I've lost that contex

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Isiah Meadows
To clarify, what engine has the bug here? I've lost that context. On Tue, Jan 10, 2017, 14:54 Michał Wadas wrote: > Actually here spec repeats itself because... > > *A conforming implementation of ECMAScript may provide additional* types, > values, objects, *properties*, and functions beyond tho

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Michał Wadas
Actually here spec repeats itself because... *A conforming implementation of ECMAScript may provide additional* types, values, objects, *properties*, and functions beyond those described in this specification. *In particular, a conforming implementation of ECMAScript may provide properties not des

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Michał Wadas
Implementations are allowed to extend objects. Otherwise presence of global/console/// would violate spec... On 10/01/17 20:21, Boris Zbarsky wrote: > On 1/10/17 2:10 PM, Raul-Sebastian Mihăilă wrote: >> Do you mean that an implementation is allowed to return an exotic object >> from the Error co

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Boris Zbarsky
On 1/10/17 2:31 PM, Michał Wadas wrote: Implementations are allowed to extend objects. Otherwise presence of global/console/// would violate spec... http://www.ecma-international.org/ecma-262/6.0/#sec-global-object explicitly says that the global object may have additional properties, so glob

getOwnPropertyDescriptor side effects

2017-01-10 Thread Raul-Sebastian Mihăilă
I disagree regarding the conformance. According to the conformance section ( https://tc39.github.io/ecma262/#sec-conformance): A conforming implementation of ECMAScript may provide additional types, values, objects, properties, and functions beyond those described in this specification. In particu

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Boris Zbarsky
On 1/10/17 2:10 PM, Raul-Sebastian Mihăilă wrote: Do you mean that an implementation is allowed to return an exotic object from the Error constructor? No, I'm saying some implementations do that, because they want to implement a non-standard "stack" property and the only way to get reasonable

getOwnPropertyDescriptor side effects

2017-01-10 Thread Raul-Sebastian Mihăilă
Do you mean that an implementation is allowed to return an exotic object from the Error constructor? https://tc39.github.io/ecma262/#sec-error-message The Error constructor calls OrdinaryCreateFromConstructor in step 2. https://tc39.github.io/ecma262/#sec-ordinarycreatefromconstructor According

Re: getOwnPropertyDescriptor side effects

2017-01-10 Thread Boris Zbarsky
On 1/10/17 1:56 AM, Raul-Sebastian Mihăilă wrote: Even if the `stack` property is non-standard, getting its property descriptor must follow the same general rules for ordinary objects. Not if its (non-standard) implementation makes the object itself non-ordinary (again, non-standard)... -Bor

Re: Cancel Promise pattern (no cancellable promises)

2017-01-10 Thread Igor Baklan
Check on practice hove [bluebirdjs-cancellation]( http://bluebirdjs.com/docs/api/cancellation.html) works and find out that [promise-executor]( https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise#Parameters).``onCancel`` callback get executed before finally blocks

Re: Cancel Promise pattern (no cancellable promises)

2017-01-10 Thread Igor Baklan
> Um... This isn't much different than Bluebird's `Promise.prototype.cancel`, > admittedly the least optimal of all these so far. Yes, very similar, in that it is propagated upward on "async-stacktrace", and can be actually handled in [promise-executor]( https://developer.mozilla.org/en/docs/Web/J