--
Gray Zhang
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
ub.io/compat-table/es6/ under "Subclassing" to see if
> your browser supports subclassing builtins yet.
>
> On Mon, May 30, 2016 at 11:32 PM, Gray Zhang <otakus...@gmail.com> wrote:
>
>> Recently I encountered an issue about subclassing Error and instance
>>
Recently I encountered an issue about subclassing Error and instance
operator, my simplified code is:
```
class MyError extends Error {
constructor() {
super('my error');
}
}
let error = new MyError();
console.log(error instanceof MyError);
console.log(error.constructor);
```
I don't really know how to name this feature, but I find it quite neccessary
In JavaScript land there are many functions with parameters of type
boolean, and invocations to these functions do not have high readability,
for example jQuery have a `clone` method with a parameter deep of type
is a promise or not
Anyway this is not an issue about spec itself, it’s more like an open
discussion, thanks for reply :)
Best regards
Gray Zhang
在 2015年6月3日 下午4:18:14, Gruenaum Benjamin (benjami...@gmail.com) 写到:
A function needs to be defined `async` if you intend to possibly use the await
cases to eliminate then calls?
Best regards
Gray Zhang
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
API is not suitable to
provide such functionality?
Best regards
Gray Zhang
在 2015年6月1日 下午12:52:26, Fink Steve (sph...@gmail.com) 写到:
Forgive me for golfing it, but
function getAllPropertyNames(o) {
if (!o) return [];
return Object.getOwnPropertyNames(o) +
getAllPropertyNames
Not exactly
Reflect.ownKeys does not walk up prototype chain so it does not return
inherited members
Reflect.enumerate seems not return non-enumerable members
What I propose is an API that returns both non-enumerable and inherited members
Best regards
Gray Zhang
在 2015年6月1日 上午1:15:58
regards
Gray Zhang
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Hi all:
I’m wondering if there is any way to combine a class decorator and an async
process together? A common case would be a generic IoC implementation:
Since in JavaScript IoC we load runtime modules async by a config file, the
interface may be:
{Promise} ioc.getComponent({string}
idea based on extended property descriptors actually being
used, e.g., with Babel? Sorry if I missed it.
Decorator is now supported with Babel 5.0 and I was trying this these days,
expecting it could be integrated with our IoC framework, just as how Spring
works in Java.
Best regards
Gray Zhang
regards
Gray Zhang
在 2015年3月2日 下午7:26:52, Gundersen Marius (gunder...@gmail.com) 写到:
I think a better term than cancel would be ignore. If the promise has side
effects then it is impossible for a cancel method to guarantee that the side
effects do not happen. For example a POST request
Recently I was reviewing my code repository and the useless of Promise, I found
we have majorly 2 scenario to use Promise:
Just match the synchronous flow control, so then matches return and catch
matches catch
Use it for a yes-or-no scenario, this is what I’m confusing
For the 2nd scenario, a
or reject), is there any potential
side effect to create a never-fulfilled promise?
Thanks
Best regards
Gray Zhang
在 2015年2月2日 上午5:46:17, de la Puente González Salvador (sa...@unoyunodiez.com)
写到:
From my point of view, rejection is the way to communicate out-of-domain
values. So
(The stop-point in code
example), then close this connection (or other ways to notify server that
remaining content is not required), this would (in some case) be benefit for
network performance.
Gray Zhang
Mail: otakus...@gmail.com
Blog: http://www.otakustay.com
Weibo: http://www.weibo.com
15 matches
Mail list logo