[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/npm-asmjs/README.md b/modules/pathkit/npm-asmjs/README.md
index a04007f..ff71af1 100644
--- a/modules/pathkit/npm-asmjs/README.md
+++ b/modules/pathkit/npm-asmjs/README.md
@@ -5,7 +5,7 @@
     <script src="/node_modules/pathkit-asmjs/bin/pathkit.js"></script>
     PathKitInit({
         locateFile: (file) => '/node_modules/pathkit-asmjs/bin/'+file,
-    }).then((PathKit) => {
+    }).ready().then((PathKit) => {
         // Code goes here using PathKit
     });
 
@@ -14,7 +14,7 @@
 is used to tell the JS loader where to find the .js.mem file. By default, it will
 look for /pathkit.js.mem, so if this is not the case, use `locateFile` to configure
 this properly.
-The `PathKit` object returned through the .then() callback is fully loaded and ready to use.
+The `PathKit` object returned upon resolution of the .ready() Promise is fully loaded and ready to use.
 
 See the [API page](https://skia.org/user/modules/pathkit) and
 [example.html](https://github.com/google/skia/blob/master/modules/pathkit/npm-asmjs/example.html)
@@ -29,7 +29,7 @@
 In the JS code, use require():
 
     const PathKitInit = require('pathkit-asmjs/bin/pathkit.js')
-    PathKitInit().then((PathKit) => {
+    PathKitInit().ready().then((PathKit) => {
         // Code goes here using PathKit
     })
 
diff --git a/modules/pathkit/npm-asmjs/example.html b/modules/pathkit/npm-asmjs/example.html
index c50c453..a2fc4c1 100644
--- a/modules/pathkit/npm-asmjs/example.html
+++ b/modules/pathkit/npm-asmjs/example.html
@@ -53,7 +53,7 @@
 
   PathKitInit({
     locateFile: (file) => '/node_modules/pathkit-asmjs/bin/'+file,
-  }).then((PathKit) => {
+  }).ready().then((PathKit) => {
     window.PathKit = PathKit;
     OutputsExample(PathKit);
     Path2DExample(PathKit);
diff --git a/modules/pathkit/npm-asmjs/package.json b/modules/pathkit/npm-asmjs/package.json
index 68b1d81..70f773c 100644
--- a/modules/pathkit/npm-asmjs/package.json
+++ b/modules/pathkit/npm-asmjs/package.json
@@ -1,6 +1,6 @@
 {
   "name": "pathkit-asmjs",
-  "version": "0.5.0",
+  "version": "0.5.1",
   "description": "A asm.js version of Skia's PathOps toolkit",
   "main": "bin/pathkit.js",
   "homepage": "https://github.com/google/skia/tree/master/modules/pathkit",