It seems as though some of the wording in section 2.1 of the specification is slightly imprecise or lacking:
The light boxes represent arbitrary JavaScript values that may flow freely between asm.js code and external JavaScript code.
The dark boxes represent types that are disallowed from escaping into external (i.e., non-asm.js) JavaScript code.
(Emphasis added.)
It follows that a value type whose values may not "flow freely between asm.js code and external JavaScript", but are also not "disallowed from escaping into external [...] JavaScript", cannot be not be depicted by a light or dark node in the subtyping DAG. Now, the only value of type void is undefined, which "asm.js is not allowed to make use of" (section 2.1.1), ruling out a light node. But undefinedis allowed to escape into external JavaScript, at least in the intuitive sense that a void function may be exported, such as in the following valid module:
function M() {
"use asm"
function f(){}
return f
}
console.log(M()()) // undefined
Since void functions may "only be called for effect" (section 2.1.1), I presume that there is some technical sense in which undefined does not actually "escape". If so, I think that this should be clarified in the specification, as it is otherwise unclear why void is depicted by a dark node.
It seems as though some of the wording in section 2.1 of the specification is slightly imprecise or lacking:
(Emphasis added.)
It follows that a value type whose values may not "flow freely between asm.js code and external JavaScript", but are also not "disallowed from escaping into external [...] JavaScript", cannot be not be depicted by a light or dark node in the subtyping DAG. Now, the only value of type
void
isundefined
, which "asm.js is not allowed to make use of" (section 2.1.1), ruling out a light node. Butundefined
is allowed to escape into external JavaScript, at least in the intuitive sense that avoid
function may be exported, such as in the following valid module:Since
void
functions may "only be called for effect" (section 2.1.1), I presume that there is some technical sense in whichundefined
does not actually "escape". If so, I think that this should be clarified in the specification, as it is otherwise unclear whyvoid
is depicted by a dark node.