We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e6aa3e + 9dd1280 commit 7f19f24Copy full SHA for 7f19f24
src/Web/Internal/FFI.js
@@ -1,9 +1,23 @@
1
"use strict";
2
3
exports._unsafeReadProtoTagged = function (nothing, just, name, value) {
4
- var ty = window[name];
5
- if (ty != null && value instanceof ty) {
6
- return just(value);
+ if (typeof window !== "undefined") {
+ var ty = window[name];
+ if (ty != null && value instanceof ty) {
7
+ return just(value);
8
+ }
9
+ return nothing;
10
11
+ var obj = value;
12
+ while (obj != null) {
13
+ var proto = Object.getPrototypeOf(obj);
14
+ var constructorName = proto.constructor.name;
15
+ if (constructorName === name) {
16
17
+ } else if (constructorName === "Object") {
18
19
20
+ obj = proto;
21
}
22
return nothing;
23
};
0 commit comments