[emscripten] Fix handling of errors in MapAsync

Caught by Closure Compiler pass on
https://github.com/kainino0x/webgpu-cross-platform-demo/tree/dawnwasm

No-Try: true
Bug: none
Change-Id: Ibc6e1c025fa2afdfcdf5f0849d0815be9ad6e0ff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/217095
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
diff --git a/third_party/emdawnwebgpu/library_webgpu.js b/third_party/emdawnwebgpu/library_webgpu.js
index d1835cb..0f65a6a 100644
--- a/third_party/emdawnwebgpu/library_webgpu.js
+++ b/third_party/emdawnwebgpu/library_webgpu.js
@@ -961,8 +961,8 @@
       var sp = stackSave();
       var messagePtr = stringToUTF8OnStack(ex.message);
       var status =
-        ex instanceof AbortError ? {{{ gpu.MapAsyncStatus.Aborted }}} :
-        ex instanceof OperationError ? {{{ gpu.MapAsyncStatus.Error }}} :
+        ex.name === 'AbortError' ? {{{ gpu.MapAsyncStatus.Aborted }}} :
+        ex.name === 'OperationError' ? {{{ gpu.MapAsyncStatus.Error }}} :
         {{{ gpu.MapAsyncStatus.Unknown }}};
         _emwgpuOnMapAsyncCompleted(futureId, status, messagePtr);
         delete WebGPU.Internals.bufferOnUnmaps[bufferPtr];