Le 20/12/2014 13:47, Gary Guo a écrit :
bindParameter function is not very hard to implement:
```
Function.prototype.bindParameter=function(idx, val){
var func=this;
return function(){
var arg=Array.prototype.slice.call(arguments);
arg[idx]=val;
func.apply(this,
On Mon, 22 Dec 2014 11:37:04 +0100, David Bruant bruan...@gmail.com
wrote:Function.prototype.bindParameter = function(...args){
return this.bind(undefined, ...args)
}
But this will bind all parameters. In Christian Mayer's situation, she wants
first three parameters unbound while your
On Mon, 22 Dec 2014 21:06:18 +0800, Glen Huang curvedm...@gmail.com
wrote:Ideally it shouldn’t, because its twin `for (var a in null) {}` won’t.
But looking at step 8 in
if you don't need a context, you can simply use it to pass anything you
want.
as example, instead of this
On Sat, Dec 20, 2014 at 12:12 PM, Christian Mayer m...@christianmayer.de
wrote:
[1,2,3].forEach( myCallback, undefined, 'additionalFoo' );
you could do this:
[1,2,3].forEach( callback,
forgot squared brckets ...
myCallback.apply(nulll, [element, count, array].concat(this));
On Mon, Dec 22, 2014 at 1:29 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
if you don't need a context, you can simply use it to pass anything you
want.
as example, instead of this
On
In that case we have a gotcha.
Is there any interest to change that behavior? Since es6 isn’t finial yet.
On Dec 22, 2014, at 9:29 PM, Gary Guo nbdd0...@hotmail.com wrote:
On Mon, 22 Dec 2014 21:06:18 +0800, Glen Huang curvedm...@gmail.com wrote:
Ideally it shouldn’t, because its twin `for
for in and for of do completely different things and there is no reason to
expect consistency between them.
This was discussed already; search esdiscuss.org.
On Dec 22, 2014 8:37 AM, Glen Huang curvedm...@gmail.com wrote:
In that case we have a gotcha.
Is there any interest to change that
doesn't fat-arrow solve this? It's not that verbose, and you can put the
arguments in any order you want
```js
[1,2,3].forEach(element = myCallback(something else, element));
```
Marius Gundersen
___
es-discuss mailing list
es-discuss@mozilla.org
Thanks. Found that discussion, and after thinking about it again, throwing
errors on null/undefined actually makes sense, because it’s impossible to
sliently loop over null/undefined with regular for loop (if you check length
directly) or forEach directly. So throwing an error is actually
From: Allen Wirfs-Brock al...@wirfs-brock.com
To: Anne van Kesteren ann...@annevk.nl
Cc: es-discuss list es-discuss@mozilla.org
Date: Sun, 21 Dec 2014 14:45:08 -0800
Subject: Re: Any news about the `module` element?
On Dec 21, 2014, at 10:10 AM, Anne van Kesteren wrote:
On Sun, Dec 21,
Actually I propose a change in texts in the specification.
CheckIterable ( obj )1. If obj is `undefined` or `null`, then return
`undefined`.2. If type(obj) is Object, then return Get(obj, @@iterator).3.
Let box be ToObject(obj).4. ReturnIfAbrupt(box).5. Return the result of
calling the
Your suggestion breaks Array.from and TypedArrayFrom.
/be
Gary Guo wrote:
I suggest we can a little bit combine these steps:
CheckIterable (obj)
1. Let box be ToObject(obj).
2. ReturnIfAbrupt(box).
3. Return the result of calling the [[Get]] internal method of box
passing @@iterator and
When a template is passed to a function, what’s the quickest way to return a
string with additional arguments being interpolated into the template?
For example,
```
minify`
ul
li${content}/li
/ul
`
```
In this case`minify` will return the minified html, but
Date: Mon, 22 Dec 2014 21:28:54 -0800
From: bren...@mozilla.org
Your suggestion breaks Array.from and TypedArrayFrom.
In the spec:
8. Let arrayLike be ToObject(items).
A type error will also be thrown since null and undefined are not
ObjectCoercible.
14 matches
Mail list logo