[pathkit] Add .ready() to initialize
See https://github.com/kripken/emscripten/issues/5820 and
https://skia-review.googlesource.com/c/skia/+/181177 for more context.
(Problem was discovered in CanvasKit, and this ports the same fix to
PathKit).
Bug: skia:
Change-Id: Ic8b2fb399210631a571595a5b3d11d1736c00def
Reviewed-on: https://skia-review.googlesource.com/c/181178
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
diff --git a/modules/pathkit/tests/effects.spec.js b/modules/pathkit/tests/effects.spec.js
index cf1e1d5..1ba372b 100644
--- a/modules/pathkit/tests/effects.spec.js
+++ b/modules/pathkit/tests/effects.spec.js
@@ -8,7 +8,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});
diff --git a/modules/pathkit/tests/path.spec.js b/modules/pathkit/tests/path.spec.js
index 7ee1aad..66bff79 100644
--- a/modules/pathkit/tests/path.spec.js
+++ b/modules/pathkit/tests/path.spec.js
@@ -8,7 +8,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});
diff --git a/modules/pathkit/tests/path2d.spec.js b/modules/pathkit/tests/path2d.spec.js
index a1bc763..6d505b7 100644
--- a/modules/pathkit/tests/path2d.spec.js
+++ b/modules/pathkit/tests/path2d.spec.js
@@ -9,7 +9,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});
diff --git a/modules/pathkit/tests/pathops.spec.js b/modules/pathkit/tests/pathops.spec.js
index 927719a..55371b0 100644
--- a/modules/pathkit/tests/pathops.spec.js
+++ b/modules/pathkit/tests/pathops.spec.js
@@ -84,7 +84,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
PATHOP_MAP = {
'kIntersect_SkPathOp': PathKit.PathOp.INTERSECT,
diff --git a/modules/pathkit/tests/svg.spec.js b/modules/pathkit/tests/svg.spec.js
index ad9e6df..577d41b 100644
--- a/modules/pathkit/tests/svg.spec.js
+++ b/modules/pathkit/tests/svg.spec.js
@@ -8,7 +8,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});
diff --git a/modules/pathkit/tests/util.spec.js b/modules/pathkit/tests/util.spec.js
index 92981b3..1423d9f 100644
--- a/modules/pathkit/tests/util.spec.js
+++ b/modules/pathkit/tests/util.spec.js
@@ -9,7 +9,7 @@
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
- }).then((_PathKit) => {
+ }).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});