Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Promise.resolve(1) throws on Android 4.0 #43

Closed
mgol opened this issue Mar 26, 2015 · 1 comment
Closed

Promise.resolve(1) throws on Android 4.0 #43

mgol opened this issue Mar 26, 2015 · 1 comment

Comments

@mgol
Copy link

mgol commented Mar 26, 2015

Promise.resolve(1) throws on Android 4.0:

TypeError: Not a promise
  at TypeError (unknown source)
  at new a (http://jquery-master.l/external/npo/npo.js:5:1481)
  at Function.<anonymous> (http://jquery-master.l/external/npo/npo.js:5:2700)
  at http://jquery-master.l/dist/test-promise.html:18:18)

This is with native-promise-only 0.7.7-a.
The tested site:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jQuery.when on Android 4.0 test page</title>
</head>
<body>
    <script src="../external/npo/npo.js"></script>
    <div id="result"></div>
    <style>
        #result {
            white-space: pre-wrap;
        }
    </style>
    <script>
        var res;
        try {
            res = Promise.resolve(1);
        } catch (e) {
            res = e.stack || e.message || e;
        }
        document.getElementById('result').textContent = res;
    </script>
</body>
</html>

I thought the jQuery test error was related to #38 but it turns out it didn't fix it.

@mgol mgol mentioned this issue Mar 26, 2015
@getify
Copy link
Owner

getify commented Mar 26, 2015

OK, it appears I did not correctly fix #38 after all. I misunderstood / misremembered. Android 4 doesn't throw an error on setting prototype with OdP, it just silently ignores. :(

@getify getify closed this as completed in e18a8de Mar 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants