Comments (7)
Don't worry about the Symbol
, the comparison graph is based on Node v5.0+, and will always use the lastest version of Node.
from yaku.
The readme is updated. You lib passed all tests. Thanks for your report.
from yaku.
Test case "subclass PromiseCapability promise.then TypeError" is still incorrect. It should not throw error. To throw error you need to specify Symbol.species
for fake constructor 😈
from yaku.
But, I read the https://tc39.github.io/ecma262/#sec-newpromisecapability
If IsCallable(promiseCapability.[[Resolve]]) is false, throw a TypeError exception.
The newly created promiseCapability
should have a resolve
handler.
from yaku.
The test case call promise.then(function () {})
with promise.constructor = function () {}
.
See 25.4.5.3 Promise.prototype.then
3 . Let C be ? SpeciesConstructor(promise, %Promise%).
Step 3 passes promise
with %Promise%
(the original Promise constructor) as defaultConstructor
- Assert: Type(O) is Object.
- Let C be ? Get(O, "constructor").
- If C is undefined, return defaultConstructor.
- If Type(C) is not Object, throw a TypeError exception.
- Let S be ? Get(C,
@@species
).- If S is either undefined or null, return defaultConstructor.
- If IsConstructor(S) is true, return S.
- Throw a TypeError exception.
Step 2: C = function () {}
Step 5: S = undefined
Step 6: return %Promise%
Then NewPromiseCapability
is called with original Promise constructor.
from yaku.
You are right, I added a global Symbol.species
to make the test possible: ccd5a01#diff-e2686e2925145c11799d638b2f4706dcR8
But I don't know why my-promise
still has 1 failure:
$ npm run no -- test-basic -s my-promise
junit cli > x basic - subclass (21ms)
<<<<<<< actual
[ 'subclass',
undefined,
'subclass',
undefined,
'subclass',
true,
true,
5,
6 ]
=======
[ 'subclass',
'subclass',
'subclass',
'subclass',
'subclass',
true,
true,
5,
6 ]
>>>>>>> expected
Error: Assertion
from yaku.
I will check it later.
from yaku.
Related Issues (20)
- Only the core works well with old browsers HOT 1
- Something strange (Slow resolve on pageload) HOT 23
- Yaku doesn't work if div with id="process" exists HOT 2
- Can't register global unhandled rejection HOT 1
- Does not work on UC Browser HOT 9
- incorrect behavior with unhandledrejection events HOT 8
- Yaku.all is overridden by yaku/utils/all on yaku.brower.full.min.js version HOT 3
- difference between return Promise.reject(x) and throw x HOT 7
- Finally swallows rejections HOT 4
- Bind to Angular 1.x digest? HOT 6
- Bad references in package.json HOT 1
- 0.18.3 is broken if window.Promise is set to Yaku HOT 3
- Implement Promise.try() ? HOT 1
- Incorrect promise when calling `resolve` twice HOT 1
- global.Promise should be non-enumerable and should have correct name property HOT 5
- "hash" util/helper request HOT 3
- Mock Mode HOT 7
- Support for Promise.allSetteled HOT 2
- Bug: Stealing a resolver and using it to trigger reentrancy HOT 3
- Promise.all and Promise.allSettled doesn't work if the promise array has been created in a different frame. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaku.