I was recently reading the specification on the behaviour of duplicate
super() calls in derived constructors. Reading the grammar the following is
valid:
```
class Foo {
constructor() {
console.log("foobar);
}
}
class Bar extends Foo {
constructor() {
super();
super();
}
}
The syntax is indeed invalid, but syntax does exist to do the equivalent:
```javascript
var { f: foo } = someObject;
```
On Mon, Jun 22, 2015 at 1:50 AM, Salehen Rahman salehen.rah...@gmail.com
wrote:
I know that `import` allows us to alias imports, like so:
```javascript
import { f as
In Babel all the experimental features are behind flags and the docs
(http://babeljs.io/docs/usage/experimental/) are very explicit about their
status:
Subject to change
These proposals are subject to change so use with extreme caution. Babel may
update without warning in order to track
Not really. It would require something like Recast
(https://github.com/benjamn/recast) to do nondescructive pretty printing to
retain as much of the source formatting as possible. This shouldn’t be
necessary though as if you’re using these experimental features extensively
enough in production
This is a limitation of Babel and not at all a reflection of the actual
specification. This restriction is imposed order to follow ES2015 semantics of
not being able to reference `this` before `super()`. It does a pretty dumb
check of only allowing it to be strictly after the call (ie. not
Ah, completely right. At first glance I thought it was this similar but
separate issue:
```js
class Foo {
constructor(callback) {
this.callback = callback; // just storing it!
}
}
class Bar extends Foo {
constructor() {
super(() = this); // reference to `this` will
So you want to add goto to JavaScript?
On Wed, May 20, 2015 at 11:42 AM, Emanuel Allen emanuelal...@hotmail.com
wrote:
Clarify:
My previous post was not that clear. That post display what I would like to
do in the language. Here is the actual code if I choose to do it as the
language is
The binding identifiers are optional. You can do what you want already with:
const lastOfThree = ([,, third]) = {
return third;
}
On Wed, Apr 29, 2015 at 12:40 PM, Elie Rotenberg e...@rotenberg.io
wrote:
Using array destructuring assignment and constraining linting rules, I
often find
Note that you’ve got the experimental REPL option enabled which means all
transformers are enabled which includes the `es7.trailingFunctionCommas` one
which allows trailing commas in function parameter lists and call expressions.
The destructuring grammar does allow trailing commas
Babel is a terrible reference implementation for subclassing since it relies on
the engine. See the docs http://babeljs.io/docs/usage/caveats/#classes and
https://github.com/babel/babel/issues/1172 for more info. This exact question
(super in derived class constructors) was also indirectly
No, you’d just memoise it to a variable:
a?.d().f?.b
to:
var _temp, _temp2;
(a != undefined ? (temp = a.d() != undefined ? (_temp2 = _temp.f != undefined
? _temp2.b : undefined) : undefined)));
You’re going to need to memoise all member expressions anyway as they might be
Reason for the verbose and quirky output in 6to5 is due to performance, see
https://github.com/6to5/6to5/pull/203
On Tue, Jan 20, 2015 at 11:45 PM, Fabrício Matté ultco...@gmail.com
wrote:
Point 2 is incorrect (e.g. `new (Foo.bind.apply(Foo,
[undefined].concat(args)))`).
I stand corrected.
http://www.slideshare.net/BrendanEich/value-objects2
On Sun, Jan 4, 2015 at 1:08 PM, Caitlin Potter caitpotte...@gmail.com
wrote:
Unfortunately, there's no real way to do this as of yet, short of abusing
ToPrimitive in certain cases, far from ideal.
I'm sure someone must have proposed it at
get away with adding that global.
/be
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
--
Sebastian McKenzie
___
es-discuss mailing list
es-discuss
14 matches
Mail list logo