mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
Avoid calling wasm parser immediately on widget module load. (#10688)
Fixes a race condition causing error in RC4: ``` index-ykDiQPdr.js:38 TypeError: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer') ```
This commit is contained in:
parent
340b22b84d
commit
b95a390854
@ -64,7 +64,7 @@ function makeLiteralFromUserInput(value: string): Ast.Owned<Ast.MutableTextLiter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const shownLiteral = computed(() => inputTextLiteral.value ?? emptyTextLiteral)
|
const shownLiteral = computed(() => inputTextLiteral.value ?? emptyTextLiteral.value)
|
||||||
const closeToken = computed(() => shownLiteral.value.close ?? shownLiteral.value.open)
|
const closeToken = computed(() => shownLiteral.value.close ?? shownLiteral.value.open)
|
||||||
|
|
||||||
const textContents = computed(() => shownLiteral.value.rawTextContent)
|
const textContents = computed(() => shownLiteral.value.rawTextContent)
|
||||||
@ -73,7 +73,8 @@ watch(textContents, (value) => (editedContents.value = value))
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
const emptyTextLiteral = makeNewLiteral('')
|
// Computed used intentionally to delay computation until wasm package is loaded.
|
||||||
|
const emptyTextLiteral = computed(() => makeNewLiteral(''))
|
||||||
function makeNewLiteral(value: string) {
|
function makeNewLiteral(value: string) {
|
||||||
return Ast.TextLiteral.new(value, MutableModule.Transient())
|
return Ast.TextLiteral.new(value, MutableModule.Transient())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user