Constructor.
Primitive types that will be passed through as-is.
Boxed primitive types that will be converted to primitives via
valueOf()
and then passed through.
Classes that will be passed through as-is.
Invokes the provided constructor if jsValue
is of a supported data type; otherwise
throws an Error.
A dom.Value subclass's constructor to call.
A Javascript value to validate/unbox before passing through to the constructor.
An optional array of strings to associate with the newly constructed dom.Value.
Provides common conversion and validation logic needed to instantiate subclasses of dom.Value from a given Javascript value of unknown type (
any
) and an optional annotations array.Given a Javascript value, will test its type to see whether it is:
valueOf()
.If the value matches any of the above descriptions, the provided constructor will be invoked with the value; otherwise, throws an Error.
Constructors are expected to be compatible with the signature:
See also: Value._fromJsValue()