Content-Length: 314270 | pFad | http://github.com/NativeScript/napi-android/commit/38e1763093b0266f1f2b78d4416ce9fab1eb31e1

6E jsc: fix tsc_helpers to handle object ctors · NativeScript/napi-android@38e1763 · GitHub
Skip to content

Commit 38e1763

Browse files
committed
jsc: fix tsc_helpers to handle object ctors
1 parent 46f7434 commit 38e1763

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: test-app/app/src/main/assets/internal/ts_helpers.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@
9292
Array.prototype.slice.call(arguments, 1)
9393
);
9494
} else {
95-
thiz = new (Function.prototype.bind.apply(
95+
thiz = new (Function.prototype.bind.apply(
9696
Extended,
9797
[null].concat(Array.prototype.slice.call(arguments, 1))
9898
))();
9999
}
100100
} else {
101-
thiz = new Extended();
101+
thiz = new Extended();
102102
}
103103
return thiz;
104104
};
@@ -107,10 +107,17 @@
107107
var Extended = extend(thiz);
108108
thiz.__container__ = true;
109109
if (args && args.length > 0) {
110-
thiz = new (Function.prototype.bind.apply(
111-
Extended,
112-
[null].concat(args)
113-
))();
110+
if (typeof Extended !== "function") {
111+
thiz = Reflect.construct(
112+
Extended,
113+
[null].concat(args)
114+
);
115+
} else {
116+
thiz = new (Function.prototype.bind.apply(
117+
Extended,
118+
[null].concat(args)
119+
))();
120+
}
114121
} else {
115122
thiz = new Extended();
116123
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/napi-android/commit/38e1763093b0266f1f2b78d4416ce9fab1eb31e1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy