Re: The result of Generator.prototype.return

2015-02-25 Thread Bergi
when your result promise is cancelled. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: The result of Generator.prototype.return

2015-02-25 Thread Bergi
Dean Landolt schrieb: On Wed, Feb 25, 2015 at 2:39 PM, Bergi wrote: If you are using generators for async, then you'd call `return()` when your result promise is cancelled. That seems a bit surprising to me -- I'd expect a cancelled promise to result in some kind of exception be

Re: Idiomatic representation of { buffer, bytesRead }

2015-03-05 Thread Bergi
Kevin Smith schrieb: Should have been: source.next(dataView) -> Promise> which you kind of need anyway ; ) Wouldn't `.next()` rather need to return an IteratorResult>? Bergi ___ es-discuss mailing list es-discuss@moz

Re: Idiomatic representation of { buffer, bytesRead }

2015-03-05 Thread Bergi
nc-iteration/ Oh, right, I should've read your first post properly - you were talking about future *asynchronous* generators. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Accepting an array as the first parameter to String.prototype.includes

2015-03-10 Thread Bergi
rray to `.includes` is rather meaningless (not denotative). If we need a method to do this (to allow for native optimisations with fancy string search algorithms), I'd suggest to use a different method name like `String.prototype.includesAll`. Bergi ___

Re: Object arithmetic--operator alternative to Object.assign

2015-03-11 Thread Bergi
e for Object.assign. It uses an ":=" operator, so your example would read obj1 := {x, y}; Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Bergi
ittedly, I think arrow functions have same problem. How is var y = (a) => a ? f : x++ (1); evaluated (or is it syntactically valid at all)? Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Forwarding `return()` in generators

2015-03-24 Thread Bergi
property that it call `.return()` on the iterator when `n` values have been taken out of it. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Forwarding `return()` in generators

2015-03-24 Thread Bergi
iterator.throw(e); done = true; } else throw e; } finally { if (!done) iterator.return(); } Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Always close iterators?

2015-03-25 Thread Bergi
Axel Rauschmayer wrote: Given that redundant calls to `return()` don’t make a difference (h/t Bergi) I'm sorry, that was not 100% accurate. I only referred to `.return(x)` returning {done:true, value:x} and `.throw(e)` being equivalent to `throw e;` when the generator was never started

Re: Always close iterators?

2015-03-25 Thread Bergi
es that, how often is it forgotten? Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Forwarding `return()` in generators

2015-03-26 Thread Bergi
which sets the respective [[Iterated*]] internal property to `undefined`? Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: short-circuiting Array.prototype.reduce

2015-03-26 Thread Bergi
absorbing element <https://en.wikipedia.org/wiki/Absorbing_element> would benefit from this. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Does async/await solve a real problem?

2015-03-29 Thread Bergi
ctive that would be very similar to your async functions. It has a nice example of such an unexpected race condition. Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: `of` operator ES7 proposal from Ian Bicking

2015-03-30 Thread Bergi
or a particular test case, this example <https://github.com/ELLIOTTCABLE/from/blob/fb19155abbf39e91a532537599d3d16f592e16b6/lib/from-new.js#L96> is not). Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Nailing object property order

2015-04-15 Thread Bergi
ilarly, we remove step 6 ("*Order the elements of names so they are in the same relative order as would be produced by the Iterator that would be returned if the [[Enumerate]] internal method was invoked on O.*") from `EnumerableOwnNames` (`Obj

Re: Nailing object property order

2015-04-16 Thread Bergi
istinction between ordered and unordered dictionaries somewhere, with tooling supporting both versions. Instead of stuffing everything into objects. How does an algorithm know whether to use `==`, `===`, `Object.is`, `Object.isSameOrdered`, `Object.equals`…? Bergi (sorry if this came off as a r

Re: Don't test promise results on their thenability multiple times

2015-04-16 Thread Bergi
would test for it twice, which even gives way to fulfilling promises with thenables - if only the `then` method is attached to your object after you have resolved your promise with it. Which could cause some quite unexpected results. Bergi ___ es

Re: stack-unlike behaviour of the execution context stack

2015-04-20 Thread Bergi
Allen Wirfs-Brock schrieb: feel free to file a ES7 bug saying that such inconsistent terminology usage should be eliminated. [X] Done: https://bugs.ecmascript.org/show_bug.cgi?id=4328 Bergi ___ es-discuss mailing list es-discuss@mozilla.org

Re: super.prop assignment can silently overwrite non-writable properties

2015-04-20 Thread Bergi
ype property. (at least that's how I understood super references) Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: is an iterator allowed to reuse the same "state" object?

2015-04-27 Thread Bergi
No, it must return a new object every time. See https://esdiscuss.org/topic/performance-of-iterator-next-as-specified for the last discussion on this. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Evaluate postfix after assignment

2015-05-12 Thread Bergi
ation order. So this is parsed to (((arr)[((i)++)])=((obj)[(e)])) and then basically evaluated left-to-right. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: let function

2015-05-14 Thread Bergi
thing :-) Yes, it will need a while until people get accustomed to that. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: let function

2015-05-18 Thread Bergi
natively just use a single equals sign with a parameter list: let f(x) = y let f() = y (which almost looks like Haskell, hehe). Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Pick operator

2015-06-22 Thread Bergi
more than single identifier. The basic examples from your motivation could easily handled by this, withoug looking much worse: let pickedObj = {o.p1, o.p2}; // uses "p1" and "p2" for property names {pickedObj.p3} = o; // takes "p3"

Re: function.sent beta equivalence?

2015-06-25 Thread Bergi
on.sent), yield* g2]; }()) with `Iterable> -> Generator>`? Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: insteadof operator

2015-06-25 Thread Bergi
(well, multiple ones actually), it's not worth the trouble of introducing a new operator. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Fwd: Re: insteadof operator

2015-06-25 Thread Bergi
shadowing, you could break out of that. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: await on synchronous functions

2015-07-19 Thread Bergi
e loaders, but at least at the top level of an app this would certainly be useful. While `JSON.parse(await fs.readFile("options.json"))` could trivially be replaced with `fs.readFileSync`, such might not be the case for `await db.readTable("con

Re: Instance bound class methods

2015-07-19 Thread Bergi
arbitrary assignments). Your example code would look like this: let someObj = { doStuff(){} }; let doStuff = ::someObj.doStuff; doStuff(); Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Extensible destructuring proposal

2015-07-21 Thread Bergi
tor](factory) { return [factory()]; } }; const WithOptions = (...args) => ({ [Symbol.extractor](factory) { return [factory(...args)]; } }); import NoOptions(A) from "a"; import WithOptions("config")(A) from "a";

Re: Extensible destructuring proposal

2015-07-21 Thread Bergi
, allowing us to get the key values of them, but this syntax does not allow us to extract the value for a given key from somewhere in the map. Predictability is all fine, but I still consider maps to be inherently unordered. Bergi ___ es-discuss mai

Re: Extensible destructuring proposal

2015-07-21 Thread Bergi
ot;destructuring" factory functions (by applying them), though I don't know whether that's the best solution for this `import` problem. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Extensible destructuring proposal

2015-07-21 Thread Bergi
that's semantically sound. We then could consider an iterator to be "not matching" if any of the target elements are left `undefined`, i.e. when the iterator is exhausted before all elements have gotten a value, similar to default initialisers are handled

Re: Extensible destructuring proposal

2015-07-21 Thread Bergi
sider new Map(Object.entries({a: 1, b: 2})) and new Map(Object.entries({b: 2, a: 1})) to be equivalent for all purposes of an algorithm that uses commutative operators. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://m

Re: please add x .= f()

2015-08-10 Thread Bergi
0is%20'%2F'>. But if you're that much inclined to save single characters, I'd recommend to use ```js s = s.slice(s[0] == '/'); ``` Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Exponentiation operator precedence

2015-08-26 Thread Bergi
esis. But that's no improvement over the current `Math.pow`. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Syntax to get same object that method was called on (Easy method chaining)

2015-10-26 Thread Bergi
, not the function call one. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Arrow function declaration

2015-10-26 Thread Bergi
g would be what I'd envision to solve your problem: ```js // does work lazy sumOfSquares = compose(sum, squares); lazy sum = reduce((x, y) => x + y, 0); lazy squares = map(x => x * x); ``` where `lazy` would work pretty much like a `lazy val` in Scala. Regards, Bergi _

Re: Concise Method Binding

2015-11-09 Thread Bergi
d to the instance. It's indeed super-confusing to "declare" such methods right inside the `class` though, that's why I'm really opposing that proposal (https://github.com/jeffmo/es-class-static-properties-and-fields). Greetings, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Generator getter method

2015-11-10 Thread Bergi
ld be quite confusing. Creating the generator explicitly is a better idea. And as kevin said, you still can return generators from your getters manually if you really want that. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org

Re: Concise Method Binding

2015-11-11 Thread Bergi
le { // a getter on the prototype get myListener() { // with per-instance memoisation return this.myListener = (…) => { // that returns a bound method … }; } } ``` It might be equivalently done via a custom decorator of course: ```js class Xample { @autobind myListener(…

Re: Concise Method Binding

2015-11-11 Thread Bergi
rson extends … { constructor(name) { super(name); this.greet = () => { return this.name + " says hi!"; }; } } ``` vs ```js class Person extends … { // with default constructor ::greet() { return this.name + " says hi!"; } } ``` Regards, Bergi

Re: String.prototype.padLeft / String.prototype.padRight

2015-11-17 Thread Bergi
* methods as well. I don't get that argument. Doesn't `start`/`end` exactly do that: ignore the locale? It always trims/pads at the start/end of the string, regardless whether that will be rendered to the left or right of the screen? Bergi

Re: String.prototype.padLeft / String.prototype.padRight

2015-11-17 Thread Bergi
mething in front of it or cut something at the beginning, regardless whether your iterator does iterate your array or structure backwards (right-to-left?), from left to right, top-down, bottom-up, or whatever direction you've drawn/imagined it in. Bergi

Re: Could String internalize an ArrayBuffer?

2015-12-06 Thread Bergi
instead of buffers (or efficiently creating buffers from strings), we'd need to introduce something like ConstTypedArrays. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Reflection to know if executed within a generator/async ?

2015-12-06 Thread Bergi
sometimes not are already known to be an antipattern. Making this obscurely dependent on some fragile syntactic conditions could only make this worse. If you want to migrate your library to asynchrony, just make it a breaking change. Your consumers will thank you for it. Kind regards, Bergi

Re: Fwd: Indirect references to variables

2015-12-08 Thread Bergi
var classReference = {Paintbrush, …}[className]; var instance = new classReference(); For additional security, you might want to use an object that doesn't inherit from `Object.prototype`, or just a `Map` right away. Regards, Bergi __

Re: Legitimate uses of IIFEs?

2015-12-20 Thread Bergi
ould be obscure. Sometimes I *want* to export promises without anyone awaiting them. And of course, exports do resolve to variable bindings, not to values, so this would be hard to align with the current spec. Regards, Bergi ___ es-discuss mailing

Re: Legitimate uses of IIFEs?

2015-12-20 Thread Bergi
Fabrício Matté schrieb: Btw, the term "IIAFE" should probably be avoided, as the "A" can ambiguously mean "Arrow" or "Async". I've never heard of an "Arrow function expression" - it's just "arrow function" :-) I th

Re: JavaScript Language feature Idea

2016-01-25 Thread Bergi
This would break much more than a `last` getter/method or `nth`/`at` method. Arrays becoming callable would mean that their `typeof` changes from `"object"` to `"function"`, which is a very bad idea. Regards, Bergi ___ es-d

Re: Using 'this' in default parameters

2016-01-29 Thread Bergi
. I wonder if this is an intended behavior? Thanks in advance. Yes, it is intended, and pretty intuitive - default initialisers are evaluated in the scope of the called function, at the call - they're not values that are computed at the time of the definit

Re: Using 'this' in default parameters

2016-01-31 Thread Bergi
t if you have an empty object constant, which is statically attached to the function instance instead of being re-evaluated at every call, that would surely cause enough havoc already :-) Regards, Bergi ___ es-discuss mailing list es-discuss@mozill

Re: Optional Chaining (aka Existential Operator, Null Propagation)

2016-02-07 Thread Bergi
the colon fits better than the dot here. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Any reason why __proto__ is not a well known symbol?

2016-02-16 Thread Bergi
they only will start or continue using it in new code. Even in code examples, or simple demonstrations, use `console.log(x, Object.getPrototypeOf(x))` over `console.log(x, x.__proto__)`. Regards, Bergi PS: Ceterum censeo __proto__ esse delendum :-)

Re: Destructuring an object into a new object (like Underscore pick but ESier)

2016-02-21 Thread Bergi
, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Destructuring an object into a new object (like Underscore pick but ESier)

2016-02-21 Thread Bergi
Viktor Kronvall schrieb: What would this do? ``` let newObj = {obj.a.b} ``` `{a: {b: obj.a.b}}` or `{a: obj.a.b}`? Or should nested property access be disallowed? Neither - `obj.a.b` is `(obj.a).b`, so it's equivalent to `let newObj = {b: obj.a.b}`. The spec would basically be something lik

Re: non-self referencial cyclical promises?

2016-02-24 Thread Bergi
d reject promise with an informative TypeError as the | reason. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Object.prototype.forIn

2016-03-07 Thread Bergi
together via `Object.keys`/`Object.getOwnProperty…`. The last case is the only one where you'd really need `hasOwnProperty`. The proliferation of `if (obj.hasOwnProperty(key))` needs to be stopped, it's cargo cult programming at best. Regards, Bergi ___

Re: stable sort proposal

2016-03-19 Thread Bergi
it that a test `if (…sort[Symbol.isStable])` will yield a falsy default value (`undefined`) in legacy implementations. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Reflect.create()

2016-05-26 Thread Bergi
ven that some of the methods are duplicated between `Object` and `Reflect`) and one would expect that they do the same or at least have a similar purpose. You seem to be proposing something completly different that has nothing to do with creation. Kind regards, Bergi __

Re: Reflect.create()

2016-05-26 Thread Bergi
e` is that we create an logical instance, but not an actual object like `Object.create` does. Sorry, you lost me here again. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Reflect.create()

2016-05-26 Thread Bergi
ge. We still don't understand how your `Reflect.create` is supposed to work or be implemented, how it is different from the old approach, and what exactly its advantage(s) will be. Kind regards, Bergi ___ es-discuss mailing list es-

Re: Oddly accepted RegExps

2016-06-03 Thread Bergi
/ - which contains an empty class that never matches anything, which is followed by a literal "]". Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Can strict parameters shadow strict function names?

2016-06-09 Thread Bergi
fied code) and use the same name for a parameter b) it should not fail in real-world engines even if the spec says something else. Regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Ambiguity with default exports and live bindings?

2016-07-06 Thread Bergi
mporting-a-function-expression-or-a-function-declaration-from-a-ES6-module. Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Class expressions in object initializers.

2016-07-13 Thread Bergi
[dynamicName]: class { … } }; but I can see absolutely no reason why you'd want to put a class inside an object literal. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Class expressions in object initializers.

2016-07-13 Thread Bergi
much easier ways to do that: let x = class { get name() { return dynamicName; } … }; or class x { … } Object.defineProperty(x, "name", { value: dynamicName }); Kind regards, Bergi ___ es-discuss mailing list

Re: The `super` keyword doesn't work as it should?

2016-07-18 Thread Bergi
;d need to use `Object.setPrototype` as there is currently no declarative way other than `class`es to define functions with custom prototypes. In methods, there would need to be a way to populate the [[HomeObject]] other than declaring the method as part of a clas

Re: The `super` keyword doesn't work as it should?

2016-07-19 Thread Bergi
quot;home"/"found" object? That's a no-no for obvious reasons. Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Alternative Promise cancellation proposal

2016-07-25 Thread Bergi
omposable syntax to developers, and gives more predicability with cancellation semantics that are easier to reason about. If you want a particular behaviour from Domenics proposal, you still can model it fairly easy with explicit rejections; In contrast, you can't get the behaviour I desire

Looking for champion (Was: Alternative Promise cancellation proposal)

2016-07-25 Thread Bergi
I am searching for a champion to present this proposal as a strawman to TC39. I would like to get an official feedback from the committee, as Domenic seems unwilling to incorporate my fundamentally different ideas into his proposal. Looking forward to see you step up, Bergi

Re: Static `super` may cause a unwanted "memory leak".

2016-08-02 Thread Bergi
Why would `tmp` be stored as the [[HomeObject]] when the function doesn't use `super`? In that case a [[HomeObject]] is not needed at all. kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Function composition syntax

2016-09-07 Thread Bergi
rtial application operator to make this syntax useful? I guess the discussions from https://github.com/tc39/proposal-bind-operator/issues/35 and https://github.com/tc39/proposal-bind-operator/issues/26 are relevant here. Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: anaphoric if and while syntax

2016-09-14 Thread Bergi
oldValue = _.get(object, 'some.long.path'); if (oldValue) object.some.long.path = transform(oldValue); } What about `else` blocks, would the variables be available in them as well? - Bergi ___ es-discuss mailing list es-discuss@mozilla

Re: Extended dot notation (pick notation) proposal

2016-09-22 Thread Bergi
ammar ambiguities, and no completely new productions, but I believe it would help a great deal. Yes, one would still have to repeat the name of the object to/from which the properties to assign/take, but that's usually rather short so it's not a large burden. I could create a proposal r

Re: Extended dot notation (pick notation) proposal

2016-09-22 Thread Bergi
27;s a bit sad that I don't see how to get to renaming and defaults with this syntax. Renaming has always been part of the language: ``` o2 = {y: o1.x} // o2.y = o1.x ({y: o2.z} = o1); // o2.z = o1.y ``` and with destructuring we'd also get defaults. - Bergi ___

Re: Clarification regarding Completion Records

2016-09-23 Thread Bergi
, so this does formally apply some common sense :-) kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Clarification regarding Completion Records

2016-09-23 Thread Bergi
cord, would they? Take `ReturnIfAbrupt` as an example. It's weird. - Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: use "One More Point" to handle async functions

2016-09-27 Thread Bergi
What you call "one more point" already exists as the `await` keyword and is much more powerful than a limited `.return` operator: <https://github.com/tc39/ecmascript-asyncawait> Please make sure to be familiar with the topic before making further prop

Re: Syntax Proposal: Add getter/setter directly on current scope ??

2016-09-27 Thread Bergi
confusion and usually a bad idea. Why not simply use a function `b()` that you can call? It's clear what happens with that. We hardly need a special syntax for getter/setter variables in lexical scopes. - Bergi ___ es-discuss mailing list es-di

Re: Why no tail calls from generators?

2016-10-12 Thread Bergi
at at least has to wrap the result in `{value: …, done:true}` would always have to stay on the stack. However, it would be possible to do tail-recursive calls in generator functions via return yield* f(…) Kind regards, Bergi ___ es-discuss mailing

Re: Power operator, why does -2**3 throws?

2016-10-14 Thread Bergi
ssion. - Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Making Object Literals a sub-class of Object

2016-10-14 Thread Bergi
easons why this is a bad idea? As you already said, it would break a great lot of code. - Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Try/Catch always needed for await?

2016-10-14 Thread Bergi
rejection, but those are usually exceptions you *don't expect* so you might not need to deal with them at all. - Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Making Object Literals a sub-class of Object

2016-10-14 Thread Bergi
f you don't care about other realms). Ooops, `Object.getPrototypeOf(o) === Object.prototype` is what I meant. - Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Alternative way to achieve cancelable promise

2016-10-19 Thread Bergi
ncellable promises automatically. This very much reminds me of my own ideas https://github.com/bergus/promise-cancellation/blob/master/enhancements.md :-) kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: Array.prototype.accumulate and Array.prototype.accumulateRight

2016-10-27 Thread Bergi
third parameter. kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Cancel Promise pattern (no cancellable promises)

2016-10-27 Thread Bergi
ops, but still at least the functions themselves will consume memory. For the simple programmer, we need an automatic (not error-prone) unsubscription mechanism once the respective cancellable operation ended. Kind regards, Bergi -- Of course, my own proposal <htt

Re: Cancel Promise pattern (no cancellable promises)

2016-10-28 Thread Bergi
Jan-Ivar Bruaroey wrote: On 10/27/16 4:25 PM, Bergi wrote: I'd however love to be able to cancel specific chaining operations, i.e. `then` callbacks. If you try the fiddle - http://jsfiddle.net/jib1/jz33qs32/ - you'll see cancelling terminates the chain. If you intersperse non-c

Re: Conditional object properties

2016-11-02 Thread Bergi
? { prop: value } : null); ``` Or depending on your condition, also just `cond && { prop: value }`. The object spread proposal will achieve the same, without the need for any extra operator. - Bergi ___ es-discuss mailing list es-discuss@mozilla.o

Re: Reflect.toStringSpec proposal

2016-12-13 Thread Bergi
can easily just use `String`. Kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Array.from API

2014-10-07 Thread Bergi
modulos of the passed values; if you really wanted to completely omit passed values you'd rather overwrite the `.from` method as a whole instead of relying on the inherited one. Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

super() call in methods

2014-12-16 Thread Bergi
llable: a no-op function. This might lead to subtle bugs, where `super()` was intended to call the parent class's method, but does nothing - not even throwing an error! Should an exception been thrown if the `func` returned by `GetSuperConstructor()` is `%FunctionPrototyp

Re: super() call in methods

2014-12-16 Thread Bergi
Allen Wirfs-Brock schrieb: On Dec 16, 2014, at 1:18 PM, Bergi wrote: ... I've read <https://esdiscuss.org/topic/referencing-super> and it seems that needing to call `super.describe()`/`super.render()`/`super.say()` is intended behaviour. I'm fine with that, as explici

Re: Proposal For A New Alternative Keyword To “this” For Classes

2019-03-09 Thread Bergi
he class fields proposal and an arrow function. However, [there are many problems with that approach](https://medium.com/@charpeni/arrow-functions-in-class-properties-might-not-be-as-great-as-we-think-3b3551c440b1) anyway. kind regards, Bergi ___ es-discu

Re: Proposal For A New Alternative Keyword To “this” For Classes

2019-03-09 Thread Bergi
to say is that your proposed alternative has exactly the same problems as instance-member arrow functions have today. Best regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal For A New Alternative Keyword To “this” For Classes

2019-03-11 Thread Bergi
xactly the same function that is passed in all three cases. There is no instance bound to `f`, and `f(event)` will not invoke it as a method (with a receiver/`this` value). Best regards, Bergi ___ es-discuss mailing list es-discuss@mozilla

Re: Proposal: Static Typing

2019-03-24 Thread Bergi
ooling could then use these annotations according to its own rules. kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: Static Typing

2019-03-25 Thread Bergi
developer productivity. kind regards, Bergi ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

  1   2   >