Skip to content

jsparser: handle parsing swc transformed @NativeClass #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ task runSbg(type: BuildToolTask) {
paramz.add("-show-deprecation-warnings")
}

if (ns_engine == "PRIMJS") {
paramz.add("-line-column-primjs")
}

setOutputs outLogger

args paramz
Expand Down
4 changes: 2 additions & 2 deletions test-app/app/src/main/assets/internal/ts_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
if (Parent.__isPrototypeImplementationObject) {
throw new Error("Can not extend an already extended native object.");
}

function extend(thiz) {
var child = thiz.__proto__.__child;
if (!child.__extended) {
var parent = thiz.__proto__.__parent;
child.__extended = parent.extend(child.name, child.prototype, true);
child.__extended = parent.extend(child.name, child.prototype, true, error);
// This will deal with "i instanceof child"
child[Symbol.hasInstance] = function (instance) {
return instance instanceof this.__extended;
Expand Down
4 changes: 2 additions & 2 deletions test-app/build-tools/buildMetadata.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Added Properties 54
Ignored Properties 2 duplicates.
Added Methods 81320
Ignored Methods 3300 duplicates.
Added Fields 54583
Ignored Fields 16676 duplicates.
Added Fields 54602
Ignored Fields 16678 duplicates.
3 changes: 3 additions & 0 deletions test-app/build-tools/jsparser/js_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const showErrorsAndWarnings =
process.argv &&
process.argv.includes("enableErrorLogging"));

const lineColumnPrimJS = process.argv.includes("-line-column-primjs");

const loggingSettings = {
logPath: require("path").join(__dirname, "logs", "i.txt"),
strategy: "console",
Expand Down Expand Up @@ -279,6 +281,7 @@ const visitAst = function (path, data, err) {
.substring(inputDir.length + 1)
.replace(/[\\]/g, "/"),
interfaceNames: interfaceNames,
isPrimJS: lineColumnPrimJS
};
es5_visitors.es5Visitor(path, decoratorConfig);
},
Expand Down
273 changes: 267 additions & 6 deletions test-app/build-tools/jsparser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading