You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 3, 2021. It is now read-only.
and we try to instantiate it with the import object {m: {g: 42}}. Is this allowed or not?
Firefox currently allows it and there seems to be no difficulty in allowing it generally, but I think the spec is vague here. The current spec text to cover this seems to be (document/js-api/index.bs line 335):
1. If |externtype| is of the form [=𝗀𝗅𝗈𝖻𝖺𝗅=] |globaltype|,
1. If |globaltype| [=Type=](|v|) is [=Number=],
1. If |globaltype| is [=𝗂𝟨𝟦=], throw a {{LinkError}} exception.
1. Let |value| be [=ToWebAssemblyValue=](|v|, |globaltype|.<em>[=global type|valtype=]</em>)
1. Let |store| be the current agent's [=associated store=].
1. Let (|store|, |globaladdr|) be [=alloc_global=](|store|, |globaltype|, |value|).
1. Set the current agent's [=associated store=] to |store|.
A globaltype can't be just a JS type I think, it needs to carry a mutability specifier. One could argue that since this is a number value the implicit mutability specifier is const, but need it be so?