Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix microtasks on iOS Pebble #967

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/core-js/internals/engine-is-ios-pebble.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var userAgent = require('../internals/engine-user-agent');
var global = require('../internals/global');

module.exports = /iphone|ipod|ipad/i.test(userAgent) && global.Pebble !== undefined;
3 changes: 2 additions & 1 deletion packages/core-js/internals/microtask.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var global = require('../internals/global');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var macrotask = require('../internals/task').set;
var IS_IOS = require('../internals/engine-is-ios');
var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');
var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');
var IS_NODE = require('../internals/engine-is-node');

Expand Down Expand Up @@ -44,7 +45,7 @@ if (!queueMicrotask) {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise && Promise.resolve) {
} else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
promise = Promise.resolve(undefined);
// workaround of WebKit ~ iOS Safari 10.1 bug
Expand Down