canceling should **not** pass through any errorback chain... Canceling is like
an explicit abort on xhr ... Not an error, not a fulfillment, it's a third
state: cancelled
-Original Message-
From: C. Scott Ananian ecmascr...@cscott.net
Sent: 27/10/2014 19:39
To: Andrea Giammarchi
So throw a different class of Error, or resolve with a different type of
object. Can you substantiate your assertion better?
In my experience, regularity of control flow constructs is a feature, not a
bug. I don't want to have to reason about some third way control flow.
--scott
The moment you pass a promise you have no control on who's adding what as
callback or errorback which means you have no control over a .reject() or
over a .success()
.cancel() would eventually keep both queues unresolved so that nothing
should happen at all: no error handling, no error happened,
On Tue, Oct 28, 2014 at 10:41 AM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
The moment you pass a promise you have no control on who's adding what as
callback or errorback which means you have no control over a .reject() or
over a .success()
.cancel() would eventually keep both
You probably want streams for typeahead, not promises.
--scott
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Dean, your idea is even better as a `Promise` *subclass*.
The subclassed cancellable promises could share a cancel flag, and
throw an exception (or resolve to a different value, whichever you
like better for the API) when the cancel flag is set. The `then`
method on `CancellablePromise` returns
While polishing some remaining corners of lexical scoping support in
V8, we stumbled over the following.
ES5 has the invariant that any identifier not found on the scope chain
_has to be_ a property of the global object (except in the presence of
'with' or sloppy direct eval), or be a reference
On Oct 28, 2014 9:10 AM, Andreas Rossberg rossb...@google.com wrote:
While polishing some remaining corners of lexical scoping support in
V8, we stumbled over the following.
ES5 has the invariant that any identifier not found on the scope chain
_has to be_ a property of the global object
On 10/28/14, 12:23 PM, Allen Wirfs-Brock wrote:
However, that won't do any thing for host defined global properties
Hmm.
That's actually a problem. The following host defined (by DOM) global
properties need to be non-configurable and not shadowable when
evaluating script in the global
On Oct 28, 2014 9:27 AM, Boris Zbarsky bzbar...@mit.edu wrote:
On 10/28/14, 12:23 PM, Allen Wirfs-Brock wrote:
However, that won't do any thing for host defined global properties
Hmm.
That's actually a problem. The following host defined (by DOM) global
properties need to be
The direction I've taken around Promise cancellation given the API surface of
the ES6 Promise has been to use a different object to handle cancellation. This
approach is similar to the Cooperative Cancelation model used in .NET. The API
for this looks something like the following (using
I actually don't want Promises at all with network interactions but you
have to explain this to all developers out there that think Promises are
the Eldorado for everything asynchronous ... I found myself needing a
cancel mechanism that goes beyond your outer scoped flag.
I really need to **drop
I've seen this too late ... but **thank you**, looking forward to read more
in here.
Best Regards
On Tue, Oct 28, 2014 at 6:22 PM, Ron Buckton rbuck...@chronicles.org
wrote:
The direction I've taken around Promise cancellation given the API surface
of the ES6 Promise has been to use a
On Tue, Oct 28, 2014 at 2:24 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
I really need to **drop that action** ... not to wait for it to fulfill and
then do something else.
This is orthogonal to the use of Promises, which just discuss control flow.
Imagine it's not about network,
Many template systems provide a programmatic mechanism (usually a simple
function call) that can be used to perform template expansion based on
passing the template string and some object that serves as mapping
dictionary, e.g.:
expand(`Hello ${x} and ${y}!`, {x: 10, y: 12});
// == Hello
Jeff Walden wrote:
On 10/27/2014 06:53 PM, Allen Wirfs-Brock wrote:
The individual typed array constructors are supposed to inherit their
[[CreateAction]] from %TypedArray% and use the definition provided
Antony Courtney wrote:
expand(`Hello ${x} and ${y}!`, {x: 10, y: 12});
// == Hello 10 and 12!
From what I've seen of drafts of ES6 template strings, templates are
expanded automatically by evaluating the expressions enclosed in
${...} at the point where the template string literal
Brendan Eich wrote:
safe_html `${x}hello, ${u}/${x}`
But you're right, the
http://people.mozilla.org/~jorendorff/es6-draft.html copy I'm finding
template in online does not include this prefix form. Did it get cut
from ES6? I thought the only debate was whether to include unprefixed
On Tue, Oct 28, 2014 at 1:44 PM, Brendan Eich bren...@mozilla.org wrote:
Brendan Eich wrote:
safe_html `${x}hello, ${u}/${x}`
But you're right, the http://people.mozilla.org/~
jorendorff/es6-draft.html copy I'm finding template in online does not
include this prefix form. Did it get cut
Thanks for the quick reply.
My impression from reading the draft spec and looking at slide 28 of
Domenic's excellent presentation
( http://www.slideshare.net/domenicdenicola/es6-the-awesome-parts )
is that with your example:
…
safe_html `${x}hello, ${u}/${x}`
if this were run in a context
Antony Courtney wrote:
I don't immediately see how this enables the more conventional model
of expansion with an explicit dictionary under control of the caller.
You don't need a template string if you want full quotation without
interpolation -- a string will do.
But why do you want a
If I am understanding you correctly, I think what you want can be accomplished
using the pattern
```js
function templater(values) {
return `hello ${values.person} it is a ${values.quality} day today`;
}
templater({ person: 'Antony', quality: 'reasonably good' });
```
On Tue, Oct 28, 2014 at 5:51 PM, Domenic Denicola d...@domenic.me wrote:
If I am understanding you correctly, I think what you want can be
accomplished using the pattern
```js
function templater(values) {
return `hello ${values.person} it is a ${values.quality} day today`;
}
Antony Courtney wrote:
function safe_html(template_string) {
// note: mapping dictionary d constructed explicitly, not based on
what's in scope where template literal appeared
var d = { x: 'strong', u: 'world'};
return template_expand(template_string, d);
}
Part of a realistic
Again, you might have an error that comes from ringTheAlarmBell() API ...
you are making the problem simple but simple is not the moment all you do
is returning a Promise with binary result (success/error) without
considering that when you reopen, much more could happen ... you **want**
to branch
I don't see any evidence that you can't handle the various cases with
the usual control flow mechanisms.
Remember that promises are isomorphic to the future async/await syntax.
--scott
___
es-discuss mailing list
es-discuss@mozilla.org
On 10/28/2014 09:10 AM, Andreas Rossberg wrote:
If so, how do we fix this? Allowing shadowing after the fact is pretty
bad, since it will probably make all accesses to builtin globals
slower in ES6. But it is particularly bad for 'undefined', where the
ability to rebind would break various
Rick Waldron wrote:
Per Anthony's OP:
My particular application is that I want to use a template system to
construct SQL queries in a modular way. For this particular
application I want programmatic control over when and how the
expansion happens and won't have the escaped template
async and await would fail here same way indeed, there should be a
mechanism to branch out the binary expected result, IMO.
The other thread and the fact .NET already has something similar should
probably ring some bell but it's probably there that we should discuss this.
Regards
On Tue, Oct
Again, I don't see how this requires some new sort of control flow.
--scott
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
try to put a cancel in your same code:
```js
function tryToAscend() {
return Door.close().then(function() { return raiseLift(); },
function(e) { return Door.open().delay(10*1000).then(tryToAscend); });
};
```
because when the door opens somebody cancel the floor and wants to descend
instead.
That all makes good sense, thanks.
To be clear: I'm not lobbying for a change to the spec. For now I just
wanted to make sure I understood the template expansion model in the
current draft spec and what it can and can't do.
I need to spend more time on my project to determine if I can make it
I'd like to be able to do something like:
function safe_html(template_string) {
// note: mapping dictionary d constructed explicitly, not based
on what's in scope where template literal appeared
var d = { x: 'strong', u: 'world'};
return
On Tue, Oct 28, 2014 at 4:12 PM, Kevin Smith zenpars...@gmail.com wrote:
I'd like to be able to do something like:
function safe_html(template_string) {
// note: mapping dictionary d constructed explicitly, not based
on what's in scope where template literal appeared
On Oct 28, 2014, at 3:32 PM, Brendan Eich bren...@mozilla.org wrote:
Jeff Walden wrote:
On 10/27/2014 06:53 PM, Allen Wirfs-Brock wrote:
The individual typed array constructors are supposed to inherit their
[[CreateAction]] from %TypedArray% and use the definition provided
On Oct 28, 2014, at 4:39 PM, Antony Courtney antony.court...@gmail.com wrote:
Thanks for the quick reply.
My impression from reading the draft spec and looking at slide 28 of
Domenic's excellent presentation
( http://www.slideshare.net/domenicdenicola/es6-the-awesome-parts )
is that
Of course, we could make it an early error to let declare ‘undefined’ and
friends at the top level of a script or module.
I suppose we could extend that to include all built-in globals. Could really
do it for host defined globals.
Allen
___
I'm proposing simply initializing a new instance and GC'ing the old
instance entirely (updating the `this` to point to the new) instead of
the current algorithm of maintaining a list of keys. I know that it
potentially slow down the method itself, but it could eliminate the
need for keeping a
Nice idea, but there seems to be (some) complications.
Set **this** to *T*.
What is `this` specifically? As far as I can see, it is a value and not a
reference. And even if it were a reference, setting it to point to another
object does not affect the other references which point to the old
What I mean is, consider this code:
```js
var wsRef = new WeakSet();
var wsRef2 = wsRef;
wsRef.clear();
```
As far as I can see, in the `wsRef.clear()` algorithm, the `this` value has
no relation with the `wsRef` identifier. Even if there was some internal
magic around changing the identifier's
On Oct 28, 2014 10:18 PM, Fabrício Matté ultco...@gmail.com wrote:
What I mean is, consider this code:
```js
var wsRef = new WeakSet();
var wsRef2 = wsRef;
wsRef.clear();
```
As far as I can see, in the `wsRef.clear()` algorithm, the `this` value
has no relation with the `wsRef`
My client needs to not glitch on me... :(
On Oct 28, 2014 10:25 PM, Isiah Meadows impinb...@gmail.com wrote:
On Oct 28, 2014 10:18 PM, Fabrício Matté ultco...@gmail.com wrote:
What I mean is, consider this code:
```js
var wsRef = new WeakSet();
var wsRef2 = wsRef;
wsRef.clear();
Not in pure ECMAScript being interpreted, but it can definitely be done
in the implementation.
Yeah I think so too, but if no where else in the specification uses this
pattern, implementations would be required to implement new mechanisms and
possibly have de-optimizations.
Actually, the de-opts shouldn't exist, considering it's effective
equivalent in C++ would be pretty straightforward (and could be polyfilled
in Node literally via native code):
```cpp
HandleJSWeakMap* createClearedInstance() {
// ...
}
// ...
HandleJSWeakMap* wm-inst =
On Tue, Oct 28, 2014 at 10:58 PM, Fabrício Matté ultco...@gmail.com wrote:
Looks nice, then. `;)` Though, this may not be so easy to implement in other
languages which don't provide direct access to memory addresses, affecting
implementations such as Rhino which is written in Java.
Nit: Object
I'm bumping the initial link: https://github.com/impinball/weakmap-weakset-clear
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
I understand that objects are passed by reference in Java (similarly to
ECMAScript), however I'm not sure how implementations link Lexical
Environments' identifiers to their respective values, and re-mapping these
would be more complicated than the C++ sample you've posted I believe.
As far as I
47 matches
Mail list logo