-
Notifications
You must be signed in to change notification settings - Fork 851
New fuzzer: PreserveImportsExportsJS #8592
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
kripken
wants to merge
42
commits into
WebAssembly:main
Choose a base branch
from
kripken:fuzz.preserve.js
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
048d6ea
go
kripken df8f132
undo
kripken b8bc054
work
kripken 511ac05
undo
kripken ea9d16d
wrk
kripken 35c3f89
wrk
kripken 7afab71
go
kripken 7487cc2
go
kripken affcb37
wrk
kripken d3100a8
wrk
kripken 8c0b563
Revert "wrk"
kripken b2dd154
wrk
kripken 8dc8547
wrk
kripken 966f784
testing
kripken 1c13ed0
moar
kripken 2aa1b9a
testing
kripken 9bb9056
testing
kripken d9a463c
testing
kripken 89c9d7d
testing
kripken 1236062
testing
kripken 5b47101
testing
kripken 1d79656
testing
kripken 33013c3
testing
kripken d3f1186
Merge remote-tracking branch 'origin/main' into fuzz.preserve.js
kripken 327e374
undo
kripken a2ee6fb
testing
kripken 8065efe
Merge remote-tracking branch 'origin/main' into fuzz.preserve.js
kripken e13fba8
restore
kripken 709eee7
clean
kripken fd2556b
clean
kripken bae026a
testing
kripken 08d20be
verify
kripken f50bd44
fuzz
kripken 345864c
fuzz
kripken ddd5098
rename
kripken da781b2
fix
kripken de3bc88
Merge remote-tracking branch 'origin/main' into fuzz.preserve.js
kripken 83b302a
clean
kripken fcbcfe8
oops
kripken 299d254
lint
kripken f11871c
sort imports
kripken 0c1b9cd
ruff
kripken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| let protoFactory = new Proxy({}, { | ||
| get(target, prop, receiver) { | ||
| // Always return a fresh, empty object. | ||
| return {}; | ||
| } | ||
| }); | ||
|
|
||
| let constructors = {}; | ||
|
|
||
| let imports = { | ||
| "protos": protoFactory, | ||
| "env": { constructors }, | ||
| }; | ||
|
|
||
| let compileOptions = { builtins: ["js-prototypes"] }; | ||
|
|
||
| let buffer = readbuffer(arguments[0]); | ||
|
|
||
| let { module, instance } = | ||
| await WebAssembly.instantiate(buffer, imports, compileOptions); | ||
|
|
||
| let Base = constructors.Base; | ||
| let Derived = constructors.Derived; | ||
|
|
||
| // Test Base | ||
| console.log("Testing Base..."); | ||
| let b = new Base(10); | ||
| console.log("b.getValue():", b.getValue()); // 10 | ||
| console.log("b.value getter:", b.value); // 10 | ||
| b.value = 20; | ||
| console.log("b.value after setter:", b.getValue()); // 20 | ||
| console.log("b instanceof Base:", b instanceof Base); // true | ||
| console.log("b instanceof Derived:", b instanceof Derived); // false | ||
|
|
||
| // Test Derived | ||
| console.log("\nTesting Derived..."); | ||
| let d = new Derived(100, 500); | ||
| console.log("d.getValue() (inherited):", d.getValue()); // 100 | ||
| console.log("d.getExtra():", d.getExtra()); // 500 | ||
| console.log("d.value getter (inherited):", d.value); // 100 | ||
| d.value = 150; | ||
| console.log("d.value after setter (inherited):", d.getValue()); // 150 | ||
| console.log("d instanceof Derived:", d instanceof Derived); // true | ||
| console.log("d instanceof Base (inheritance):", d instanceof Base); // true | ||
| console.log("Derived.staticMethod():", Derived.staticMethod()); // 42 | ||
|
|
||
| // Test Wasm-side descriptor checks | ||
| console.log("\nTesting Wasm-side descriptor checks..."); | ||
| console.log("checkDesc(b):", instance.exports.checkDesc(b)); // 1 | ||
| console.log("checkDesc(d):", instance.exports.checkDesc(d)); // 2 | ||
| console.log("isDerived(b):", instance.exports.isDerived(b)); // 0 | ||
| console.log("isDerived(d):", instance.exports.isDerived(d)); // 1 | ||
|
|
||
| // Test cross-checks | ||
| console.log("\nTesting cross-checks..."); | ||
| console.log("get_base_val(d):", instance.exports.get_base_val(d)); // 150 |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this less frequently given how few starting configurations it has?