Conversation
…dd es6 class support
…nments Plus, a few misc improvements here and there.
A small, separate helper. Why? Because I'd like to keep n/sig specific stuff out of the analyzer and extractor, as they are supposed to be generic and agnostic. This is also so the user doesn't have to connect the dots themselves when setting up their js interpreters.
…e, unrelated) Unrelated. Updated it for testing some things.
For consistency.
4 tasks
I had other plans for this... Not anymore, though.
absidue
reviewed
Mar 15, 2026
Collaborator
absidue
left a comment
There was a problem hiding this comment.
Code looks good! The documentation about Platform.shim.eval will need to be updated. I will do some testing in FreeTube before I approve the PR.
absidue
approved these changes
Mar 15, 2026
|
How to use extracted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for the recent player js variants.
Surprisingly, this didn't require many changes to get working properly. Aside from fixing a few nasty bugs, I just had to add support for prototype aliases and ES6 classes (and update the matcher, obviously). I also threw in a few misc changes.
To summarize:
JsAnalyzerto correctly attribute member assignments made through aliases (e.g., trackinga.b.foo = ...aftera.b = g.c.prototype).ClassExpression), ignore irrelevant identifiers (e.g., class method names, meta properties), and correctly manage block scopes forforstatements.vardeclarations.Platform.shim.evalfn, a simplereturn new Function(data.output)();is enough.It works fine for my use cases (& env), but I changed some of the global var stuff included the output code, so more testing is welcome (CC @absidue):
