Comments (17)
Thanks for the bug report.
from native-promise-only.
Could you try out the candidate fix in 306216f and let me know if it works? I don't have an appropriate device to test with.
from native-promise-only.
Will do. Clocking off time here in England, I'll try tomorrow morning
from native-promise-only.
OK, thanks!
On Wed, Nov 5, 2014 at 10:55 AM, Darren Hurley [email protected]
wrote:
Will do. Clocking off time here in England, I'll try tomorrow morning
—
Reply to this email directly or view it on GitHub
#38 (comment)
.
from native-promise-only.
Hmmm, doesn't quite work. Looks like it only fails specifically when setting the prototype on a function, i.e.
var func = function () {},
proto = {};
builtInProp(func, 'prototype', proto, false);
alert(func.prototype === proto);
alerts false, as expected. If func = {}
, alerts true
from native-promise-only.
Thanks - will fix it
On Thu, Nov 6, 2014 at 4:15 AM, Darren Hurley [email protected]
wrote:
Hmmm, doesn't quite work. Looks like it only fails specifically when setting the prototype on a function, i.e.
var func = function () {}, proto = {}; builtInProp(func, 'prototype', proto, false); alert(func.prototype === proto);
alerts false, as expected. If
func = {}
, alerts trueReply to this email directly or view it on GitHub:
#38 (comment)
from native-promise-only.
I made x be a function () {}
-- when you have a chance, let me know if the new fix works.
Thanks!
from native-promise-only.
Unfortunately my test was incorrect - it should check for
var y = function() {} , x = {};
Object.defineProperty(y, "prototype", { value: x });
if (y.prototype === x) throw;
Can you please verify, again, with the new corrected code?
from native-promise-only.
(FYI: I updated my suggested gist with this correction, too: https://gist.github.com/getify/906aadd914a675ea4a57)
from native-promise-only.
@smikes Confirming that 67d8223 fixes it. It look me a little longer to test this because a build step is required. For what it's worth, npm build
doesn't work, but node build
does.
from native-promise-only.
Thanks.
Yes, npm build
would run node-gyp if there was a bindings.gyp
, while npm run-script build
is necessary to run the 'build' script defined in package.json
from native-promise-only.
jQuery is now using NPO to test compliance of its Deferreds against the Promises/A+ tests and this issue is causing jQuery.when
tests to fail. See http://swarm.jquery.org/result/99082
What else is needed to get #38 merged?
from native-promise-only.
Sorry that this got hung up for so long on #41. We were discussing possible file reorg and tests and such, and I think we missed the forest for the trees. So I've just landed a fix only for the Android thing (hopefully!).
from native-promise-only.
@getify Thanks! It turns out jQuery test errors are caused by another issue, see #43.
from native-promise-only.
Actually, I didn't fix this issue correctly after all. :(
from native-promise-only.
Man, this android4 browser behavior is insane. If you use Object.defineProperty
, it actually does change the descriptor, but not the underlying function value. Then, even better, subsequently if you try to set it with normal =
assignment, THAT assignment silently fails. =
assignment only works if you haven't previously done the Object.defineProperty
.
from native-promise-only.
For posterity sake, the observation I made was that the builtInProp(..)
usage before was actually setting the same sort of descriptor (writable:true, enumerable:false, configurable:false
) as is already true of function prototypes (per spec)... so the normal =
assignment is shorter, accomplishes the exact same outcome, and most importantly doesn't trigger this android4 stupidity.
Ironic/unfortunate that the OP suggested exactly this, and it took me all this time and wrapping around the issue to come to the same conclusion. :/
from native-promise-only.
Related Issues (20)
- browsers support information HOT 7
- Cross-Browser Support & Tests HOT 3
- Support IE8 HOT 5
- What is correct execution sequence when attach multiple handlers to the same promise. HOT 8
- Better native support detection? HOT 3
- Create tag for v0.7.6-a HOT 1
- AMD? HOT 19
- handling uncaught exceptions HOT 5
- Promise.resolve(1) throws on Android 4.0 HOT 1
- `resolve(..)` should call a thenable's `then(..)` async, not sync. HOT 5
- Unhandled rejection detection HOT 9
- Suggestion: make Promise.prototype aliases of `then` and `catch` HOT 5
- Error when running through babel compiler HOT 5
- Module with unminified code should be exported by default
- on nodejs, exceptions are not shown. HOT 4
- Microtasks? HOT 1
- Ponyfill support? HOT 1
- Missing tag for version 0.7.8-a used by jQuery HOT 7
- Promise finally not supported HOT 1
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 native-promise-only.