Skip to content

Commit 32e1eeb

Browse files
committed
jsparser: handle parsing swc transformed @nativeclass
1 parent 5e48302 commit 32e1eeb

File tree

9 files changed

+674
-16
lines changed

9 files changed

+674
-16
lines changed

test-app/app/src/main/assets/internal/ts_helpers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,20 @@
6464
throw new Error("Can not extend an already extended native object.");
6565
}
6666

67+
let error = new Error("");
68+
69+
console.log(error.stack.split("\n")[2]);
70+
6771
function extend(thiz) {
6872
var child = thiz.__proto__.__child;
6973
if (!child.__extended) {
7074
var parent = thiz.__proto__.__parent;
71-
child.__extended = parent.extend(child.name, child.prototype, true);
75+
child.__extended = parent.extend(child.name, child.prototype, true, error);
7276
// This will deal with "i instanceof child"
7377
child[Symbol.hasInstance] = function (instance) {
7478
return instance instanceof this.__extended;
7579
};
80+
error = null;
7681
}
7782
return child.__extended;
7883
}

test-app/build-tools/jsparser/package-lock.json

Lines changed: 267 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-app/build-tools/jsparser/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
},
1919
"repository": "https://github.com/NativeScript/android-runtime",
2020
"devDependencies": {
21+
"@types/babel__traverse": "^7.20.6",
22+
"@types/split": "^1.0.5",
2123
"webpack": "5.70.0",
2224
"webpack-cli": "4.9.2"
2325
}

0 commit comments

Comments
 (0)