mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
wasm gc: fix String.intern support
This commit is contained in:
parent
2aabddc32d
commit
802efd49c6
|
@ -83,6 +83,14 @@ TeaVM.wasm = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function coreImports(imports) {
|
function coreImports(imports) {
|
||||||
|
let finalizationRegistry = new FinalizationRegistry(heldValue => {
|
||||||
|
if (typeof exports.reportGarbageCollectedValue === "function") {
|
||||||
|
exports.reportGarbageCollectedValue(heldValue)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let stringFinalizationRegistry = new FinalizationRegistry(heldValue => {
|
||||||
|
exports.reportGarbageCollectedString(heldValue);
|
||||||
|
});
|
||||||
imports.teavm = {
|
imports.teavm = {
|
||||||
createWeakRef(value, heldValue) {
|
createWeakRef(value, heldValue) {
|
||||||
let weakRef = new WeakRef(value);
|
let weakRef = new WeakRef(value);
|
||||||
|
@ -102,14 +110,6 @@ TeaVM.wasm = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsoImports(imports) {
|
function jsoImports(imports) {
|
||||||
new FinalizationRegistry(heldValue => {
|
|
||||||
if (typeof exports.reportGarbageCollectedValue === "function") {
|
|
||||||
exports.reportGarbageCollectedValue(heldValue)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
new FinalizationRegistry(heldValue => {
|
|
||||||
exports.reportGarbageCollectedString(heldValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
let javaObjectSymbol = Symbol("javaObject");
|
let javaObjectSymbol = Symbol("javaObject");
|
||||||
let functionsSymbol = Symbol("functions");
|
let functionsSymbol = Symbol("functions");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user