Module: stdgo.syscall.js
Overview
Package js gives access to the WebAssembly host environment when using the js/wasm architecture. Its API is based on JavaScript semantics.
This package is EXPERIMENTAL. Its current scope is only to allow tests to run, but not yet to provide a comprehensive API for users. It is exempt from the Go compatibility promise.
Index
-
function _floatValue(_f:stdgo.GoFloat64):stdgo.syscall.js.Value
-
function _jsString(_v:stdgo.syscall.js.Value):stdgo.GoString
-
function _makeValue(_r:stdgo.syscall.js.T_ref):stdgo.syscall.js.Value
-
function _predefValue(_id:stdgo.GoUInt32, _typeFlag:stdgo.GoByte):stdgo.syscall.js.Value
-
function _stringVal(_x:stdgo.GoString):stdgo.syscall.js.T_ref
-
function _valueDelete(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString):Void
-
function _valueGet(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString):stdgo.syscall.js.T_ref
-
function _valueIndex(_v:stdgo.syscall.js.T_ref, _i:stdgo.GoInt):stdgo.syscall.js.T_ref
-
function _valueInstanceOf(_v:stdgo.syscall.js.T_ref, _t:stdgo.syscall.js.T_ref):Bool
-
function _valueLength(_v:stdgo.syscall.js.T_ref):stdgo.GoInt
-
function _valueLoadString(_v:stdgo.syscall.js.T_ref, _b:stdgo.Slice<stdgo.GoByte>):Void
-
function _valueSet(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString, _x:stdgo.syscall.js.T_ref):Void
-
function _valueSetIndex(_v:stdgo.syscall.js.T_ref, _i:stdgo.GoInt, _x:stdgo.syscall.js.T_ref):Void
-
function copyBytesToGo(_dst:stdgo.Slice<stdgo.GoByte>, _src:stdgo.syscall.js.Value):stdgo.GoInt
-
function copyBytesToJS(_dst:stdgo.syscall.js.Value, _src:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt
-
function valueOf(_x:stdgo.AnyInterface):stdgo.syscall.js.Value
-
function call(_m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function invoke(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function new(?value:stdgo.syscall.js.Value, ?_id:stdgo.GoUInt32):Void
-
function new_(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function setIndex(_i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
-
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
-
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
-
function call(_m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function invoke(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function new_(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function setIndex(_i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
-
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
-
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
-
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
-
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
-
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
-
function new(?method:stdgo.GoString, ?type:Null<stdgo.syscall.js.Type_>):Void
Constants
import stdgo.syscall.js.Js
final _nanHead:stdgo.GoUInt64 = ((0 : stdgo.GoUInt64))
nanHead are the upper 32 bits of a ref which are set if the value is not encoded as an IEEE 754 number (see above).
final _typeFlagFunction:Null<Dynamic> = @:invalid_type null
final _typeFlagNone:stdgo.GoUInt64 = ((0 : stdgo.GoUInt64))
the type flags need to be in sync with wasm_exec.js
final _typeFlagObject:Null<Dynamic> = @:invalid_type null
final _typeFlagString:Null<Dynamic> = @:invalid_type null
final _typeFlagSymbol:Null<Dynamic> = @:invalid_type null
final typeBoolean:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeFunction:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeNull:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeNumber:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeObject:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeString:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeSymbol:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
final typeUndefined:stdgo.syscall.js.Type_ = ((((0 : stdgo.GoInt)) : stdgo.syscall.js.Js.Type_))
Variables
import stdgo.syscall.js.Js
var _arrayConstructor:stdgo.syscall.js.Value
var _funcs:stdgo.GoMap<stdgo.GoUInt32, (:stdgo.syscall.js.Value, :stdgo.Slice<stdgo.syscall.js.Value>):stdgo.AnyInterface>
var _funcsMu:stdgo.sync.Mutex
var _jsGo:stdgo.syscall.js.Value
instance of the Go class in JavaScript
var _nextFuncID:stdgo.GoUInt32
var _objectConstructor:stdgo.syscall.js.Value
var _valueFalse:stdgo.syscall.js.Value
var _valueGlobal:stdgo.syscall.js.Value
var _valueNaN:stdgo.syscall.js.Value
var _valueNull:stdgo.syscall.js.Value
var _valueTrue:stdgo.syscall.js.Value
var _valueUndefined:stdgo.syscall.js.Value
var _valueZero:stdgo.syscall.js.Value
Functions
import stdgo.syscall.js.Js
function _copyBytesToGo
function _copyBytesToGo(_dst:stdgo.Slice<stdgo.GoByte>, _src:stdgo.syscall.js.T_ref):{
_1:Bool;
_0:stdgo.GoInt;
}
go:wasmimport gojs syscall/js.copyBytesToGo
function _copyBytesToJS
function _copyBytesToJS(_dst:stdgo.syscall.js.T_ref, _src:stdgo.Slice<stdgo.GoByte>):{
_1:Bool;
_0:stdgo.GoInt;
}
go:wasmimport gojs syscall/js.copyBytesToJS
function _finalizeRef
function _finalizeRef(_r:stdgo.syscall.js.T_ref):Void
go:wasmimport gojs syscall/js.finalizeRef
function _floatValue
function _floatValue(_f:stdgo.GoFloat64):stdgo.syscall.js.Value
function _handleEvent
function _handleEvent():Bool
handleEvent retrieves the pending event (window._pendingEvent) and calls the js.Func on it. It returns true if an event was handled.
function _jsString
function _jsString(_v:stdgo.syscall.js.Value):stdgo.GoString
function _makeArgs
function _makeArgs(_args:stdgo.Slice<stdgo.AnyInterface>):{
_1:stdgo.Slice<stdgo.syscall.js.T_ref>;
_0:stdgo.Slice<stdgo.syscall.js.Value>;
}
function _makeValue
function _makeValue(_r:stdgo.syscall.js.T_ref):stdgo.syscall.js.Value
function _predefValue
function _predefValue(_id:stdgo.GoUInt32, _typeFlag:stdgo.GoByte):stdgo.syscall.js.Value
function _setEventHandler
function _setEventHandler(_fn:():Bool):Void
setEventHandler is defined in the runtime package.
function _stringVal
function _stringVal(_x:stdgo.GoString):stdgo.syscall.js.T_ref
go:wasmimport gojs syscall/js.stringVal
function _valueCall
function _valueCall(_v:stdgo.syscall.js.T_ref, _m:stdgo.GoString, _args:stdgo.Slice<stdgo.syscall.js.T_ref>):{
_1:Bool;
_0:stdgo.syscall.js.T_ref;
}
go:wasmimport gojs syscall/js.valueCall go:nosplit
function _valueDelete
function _valueDelete(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString):Void
go:wasmimport gojs syscall/js.valueDelete
function _valueGet
function _valueGet(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString):stdgo.syscall.js.T_ref
go:wasmimport gojs syscall/js.valueGet
function _valueIndex
function _valueIndex(_v:stdgo.syscall.js.T_ref, _i:stdgo.GoInt):stdgo.syscall.js.T_ref
go:wasmimport gojs syscall/js.valueIndex
function _valueInstanceOf
function _valueInstanceOf(_v:stdgo.syscall.js.T_ref, _t:stdgo.syscall.js.T_ref):Bool
go:wasmimport gojs syscall/js.valueInstanceOf
function _valueInvoke
function _valueInvoke(_v:stdgo.syscall.js.T_ref, _args:stdgo.Slice<stdgo.syscall.js.T_ref>):{
_1:Bool;
_0:stdgo.syscall.js.T_ref;
}
go:wasmimport gojs syscall/js.valueInvoke
function _valueLength
function _valueLength(_v:stdgo.syscall.js.T_ref):stdgo.GoInt
go:wasmimport gojs syscall/js.valueLength
function _valueLoadString
function _valueLoadString(_v:stdgo.syscall.js.T_ref, _b:stdgo.Slice<stdgo.GoByte>):Void
go:wasmimport gojs syscall/js.valueLoadString
function _valueNew
function _valueNew(_v:stdgo.syscall.js.T_ref, _args:stdgo.Slice<stdgo.syscall.js.T_ref>):{
_1:Bool;
_0:stdgo.syscall.js.T_ref;
}
go:wasmimport gojs syscall/js.valueNew
function _valuePrepareString
function _valuePrepareString(_v:stdgo.syscall.js.T_ref):{
_1:stdgo.GoInt;
_0:stdgo.syscall.js.T_ref;
}
go:wasmimport gojs syscall/js.valuePrepareString
function _valueSet
function _valueSet(_v:stdgo.syscall.js.T_ref, _p:stdgo.GoString, _x:stdgo.syscall.js.T_ref):Void
go:wasmimport gojs syscall/js.valueSet
function _valueSetIndex
function _valueSetIndex(_v:stdgo.syscall.js.T_ref, _i:stdgo.GoInt, _x:stdgo.syscall.js.T_ref):Void
go:wasmimport gojs syscall/js.valueSetIndex
function copyBytesToGo
function copyBytesToGo(_dst:stdgo.Slice<stdgo.GoByte>, _src:stdgo.syscall.js.Value):stdgo.GoInt
CopyBytesToGo copies bytes from src to dst. It panics if src is not a Uint8Array or Uint8ClampedArray. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst.
function copyBytesToJS
function copyBytesToJS(_dst:stdgo.syscall.js.Value, _src:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt
CopyBytesToJS copies bytes from src to dst. It panics if dst is not a Uint8Array or Uint8ClampedArray. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst.
function funcOf
function funcOf(_fn:(_this:stdgo.syscall.js.Value, _args:stdgo.Slice<stdgo.syscall.js.Value>):stdgo.AnyInterface):stdgo.syscall.js.Func
FuncOf returns a function to be used by JavaScript.
The Go function fn is called with the value of JavaScript's "this" keyword and the arguments of the invocation. The return value of the invocation is the result of the Go function mapped back to JavaScript according to ValueOf.
Invoking the wrapped Go function from JavaScript will pause the event loop and spawn a new goroutine. Other wrapped functions which are triggered during a call from Go to JavaScript get executed on the same goroutine.
As a consequence, if one wrapped function blocks, JavaScript's event loop is blocked until that function returns. Hence, calling any async JavaScript API, which requires the event loop, like fetch (http.Client), will cause an immediate deadlock. Therefore a blocking function should explicitly start a new goroutine.
Func.Release must be called to free up resources when the function will not be invoked any more.
function global
function global():stdgo.syscall.js.Value
Global returns the JavaScript global object, usually "window" or "global".
function null_
function null_():stdgo.syscall.js.Value
Null returns the JavaScript value "null".
function undefined
function undefined():stdgo.syscall.js.Value
Undefined returns the JavaScript value "undefined".
function valueOf
function valueOf(_x:stdgo.AnyInterface):stdgo.syscall.js.Value
ValueOf returns x as a JavaScript value:
| Go | JavaScript |
| ---------------------- | ---------------------- |
| js.Value | [its value] |
| js.Func | function |
| nil | null |
| bool | boolean |
| integers and floats | number |
| string | string |
| []interface{} | new array |
| map[string]interface{} | new object |
Panics if x is not one of the expected types.
Classes
import stdgo.syscall.js.*
class Func
Func is a wrapped Go function to be called by JavaScript.
var _id:stdgo.GoUInt32
var value:stdgo.syscall.js.Value
Func function _float
function _float(_p:stdgo.GoString):stdgo.GoFloat64
Func function _isNumber
function _isNumber():Bool
Func function bool_
function bool_():Bool
Func function call
function call(_m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function delete
function delete(_p:stdgo.GoString):Void
Func function equal
function equal(__0:stdgo.syscall.js.Value):Bool
Func function float_
function float_():stdgo.GoFloat64
Func function get
function get(_p:stdgo.GoString):stdgo.syscall.js.Value
Func function index
function index(_i:stdgo.GoInt):stdgo.syscall.js.Value
Func function instanceOf
function instanceOf(__0:stdgo.syscall.js.Value):Bool
Func function int_
function int_():stdgo.GoInt
Func function invoke
function invoke(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function isNaN
function isNaN():Bool
Func function isNull
function isNull():Bool
Func function isUndefined
function isUndefined():Bool
Func function length_
function length_():stdgo.GoInt
Func function new
function new(?value:stdgo.syscall.js.Value, ?_id:stdgo.GoUInt32):Void
Func function new_
function new_(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function set
function set(_p:stdgo.GoString, _x:stdgo.AnyInterface):Void
Func function setIndex
function setIndex(_i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
Func function string
function string():stdgo.GoString
Func function truthy
function truthy():Bool
Func function type
function type():stdgo.syscall.js.Type_
Func function _float
function _float( _p:stdgo.GoString):stdgo.GoFloat64
Func function _isNumber
function _isNumber():Bool
Func function bool_
function bool_():Bool
Func function call
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function delete
function delete( _p:stdgo.GoString):Void
Func function equal
function equal( __0:stdgo.syscall.js.Value):Bool
Func function float_
function float_():stdgo.GoFloat64
Func function get
function get( _p:stdgo.GoString):stdgo.syscall.js.Value
Func function index
function index( _i:stdgo.GoInt):stdgo.syscall.js.Value
Func function instanceOf
function instanceOf( __0:stdgo.syscall.js.Value):Bool
Func function int_
function int_():stdgo.GoInt
Func function invoke
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function isNaN
function isNaN():Bool
Func function isNull
function isNull():Bool
Func function isUndefined
function isUndefined():Bool
Func function length_
function length_():stdgo.GoInt
Func function new_
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Func function release
function release():Void
Release frees up resources allocated for the function. The function must not be invoked after calling Release. It is allowed to call Release while the function is still running.
Func function set
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
Func function setIndex
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
Func function string
function string():stdgo.GoString
Func function truthy
function truthy():Bool
Func function type
function type():stdgo.syscall.js.Type_
class T_error
Error wraps a JavaScript error.
var value:stdgo.syscall.js.Value
Value is the underlying JavaScript error value.
T_error function _float
function _float(_p:stdgo.GoString):stdgo.GoFloat64
T_error function _isNumber
function _isNumber():Bool
T\error function bool\
function bool_():Bool
T_error function call
function call(_m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function delete
function delete(_p:stdgo.GoString):Void
T_error function equal
function equal(__0:stdgo.syscall.js.Value):Bool
T\error function float\
function float_():stdgo.GoFloat64
T_error function get
function get(_p:stdgo.GoString):stdgo.syscall.js.Value
T_error function index
function index(_i:stdgo.GoInt):stdgo.syscall.js.Value
T_error function instanceOf
function instanceOf(__0:stdgo.syscall.js.Value):Bool
T\error function int\
function int_():stdgo.GoInt
T_error function invoke
function invoke(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function isNaN
function isNaN():Bool
T_error function isNull
function isNull():Bool
T_error function isUndefined
function isUndefined():Bool
T\error function length\
function length_():stdgo.GoInt
T_error function new
function new(?value:stdgo.syscall.js.Value):Void
T\error function new\
function new_(_args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function set
function set(_p:stdgo.GoString, _x:stdgo.AnyInterface):Void
T_error function setIndex
function setIndex(_i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
T_error function string
function string():stdgo.GoString
T_error function truthy
function truthy():Bool
T_error function type
function type():stdgo.syscall.js.Type_
T_error function _float
function _float( _p:stdgo.GoString):stdgo.GoFloat64
T_error function _isNumber
function _isNumber():Bool
T\error function bool\
function bool_():Bool
T_error function call
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function delete
function delete( _p:stdgo.GoString):Void
T_error function equal
function equal( __0:stdgo.syscall.js.Value):Bool
T_error function error
function error():stdgo.GoString
Error implements the error interface.
T\error function float\
function float_():stdgo.GoFloat64
T_error function get
function get( _p:stdgo.GoString):stdgo.syscall.js.Value
T_error function index
function index( _i:stdgo.GoInt):stdgo.syscall.js.Value
T_error function instanceOf
function instanceOf( __0:stdgo.syscall.js.Value):Bool
T\error function int\
function int_():stdgo.GoInt
T_error function invoke
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function isNaN
function isNaN():Bool
T_error function isNull
function isNull():Bool
T_error function isUndefined
function isUndefined():Bool
T\error function length\
function length_():stdgo.GoInt
T\error function new\
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
T_error function set
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
T_error function setIndex
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
T_error function string
function string():stdgo.GoString
T_error function truthy
function truthy():Bool
T_error function type
function type():stdgo.syscall.js.Type_
class Value
Value represents a JavaScript value. The zero value is the JavaScript value "undefined". Values can be checked for equality with the Equal method.
var __26:stdgo.GoArray<():Void>
var _gcPtr:stdgo.Pointer<stdgo.syscall.js.T_ref>
var _ref:stdgo.syscall.js.T_ref
Value function new
function new(?__26:stdgo.GoArray<():Void>, ?_ref:Null<stdgo.syscall.js.T_ref>, ?_gcPtr:stdgo.Pointer<stdgo.syscall.js.T_ref>):Void
Value function _float
function _float( _method:stdgo.GoString):stdgo.GoFloat64
Value function _isNumber
function _isNumber():Bool
Value function bool_
function bool_():Bool
Bool returns the value v as a bool. It panics if v is not a JavaScript boolean.
Value function call
function call( _m:stdgo.GoString, _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Call does a JavaScript call to the method m of value v with the given arguments. It panics if v has no method m. The arguments get mapped to JavaScript values according to the ValueOf function.
Value function delete
function delete( _p:stdgo.GoString):Void
Delete deletes the JavaScript property p of value v. It panics if v is not a JavaScript object.
Value function equal
function equal( _w:stdgo.syscall.js.Value):Bool
Equal reports whether v and w are equal according to JavaScript's === operator.
Value function float_
function float_():stdgo.GoFloat64
Float returns the value v as a float64. It panics if v is not a JavaScript number.
Value function get
function get( _p:stdgo.GoString):stdgo.syscall.js.Value
Get returns the JavaScript property p of value v. It panics if v is not a JavaScript object.
Value function index
function index( _i:stdgo.GoInt):stdgo.syscall.js.Value
Index returns JavaScript index i of value v. It panics if v is not a JavaScript object.
Value function instanceOf
function instanceOf( _t:stdgo.syscall.js.Value):Bool
InstanceOf reports whether v is an instance of type t according to JavaScript's instanceof operator.
Value function int_
function int_():stdgo.GoInt
Int returns the value v truncated to an int. It panics if v is not a JavaScript number.
Value function invoke
function invoke( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
Invoke does a JavaScript call of the value v with the given arguments. It panics if v is not a JavaScript function. The arguments get mapped to JavaScript values according to the ValueOf function.
Value function isNaN
function isNaN():Bool
IsNaN reports whether v is the JavaScript value "NaN".
Value function isNull
function isNull():Bool
IsNull reports whether v is the JavaScript value "null".
Value function isUndefined
function isUndefined():Bool
IsUndefined reports whether v is the JavaScript value "undefined".
Value function length_
function length_():stdgo.GoInt
Length returns the JavaScript property "length" of v. It panics if v is not a JavaScript object.
Value function new_
function new_( _args:haxe.Rest<stdgo.AnyInterface>):stdgo.syscall.js.Value
New uses JavaScript's "new" operator with value v as constructor and the given arguments. It panics if v is not a JavaScript function. The arguments get mapped to JavaScript values according to the ValueOf function.
Value function set
function set( _p:stdgo.GoString, _x:stdgo.AnyInterface):Void
Set sets the JavaScript property p of value v to ValueOf(x). It panics if v is not a JavaScript object.
Value function setIndex
function setIndex( _i:stdgo.GoInt, _x:stdgo.AnyInterface):Void
SetIndex sets the JavaScript index i of value v to ValueOf(x). It panics if v is not a JavaScript object.
Value function string
function string():stdgo.GoString
String returns the value v as a string.
String is a special case because of Go's String method convention. Unlike the other getters,
it does not panic if v's Type is not TypeString. Instead, it returns a string of the form "\
Value function truthy
function truthy():Bool
Truthy returns the JavaScript "truthiness" of the value v. In JavaScript, false, 0, "", null, undefined, and NaN are "falsy", and everything else is "truthy". See https://developer.mozilla.org/en-US/docs/Glossary/Truthy.
Value function type
function type():stdgo.syscall.js.Type_
Type returns the JavaScript type of the value v. It is similar to JavaScript's typeof operator, except that it returns TypeNull instead of TypeObject for null.
class ValueError
A ValueError occurs when a Value method is invoked on a Value that does not support it. Such cases are documented in the description of each method.
var method:stdgo.GoString
var type:stdgo.syscall.js.Type_
ValueError function new
function new(?method:stdgo.GoString, ?type:Null<stdgo.syscall.js.Type_>):Void
ValueError function error
function error():stdgo.GoString
Typedefs
import stdgo.syscall.js.*
typedef T_ref
typedef T_ref = stdgo.GoUInt64;
ref is used to identify a JavaScript value, since the value itself can not be passed to WebAssembly.
The JavaScript value "undefined" is represented by the value 0. A JavaScript number (64-bit float, except 0 and NaN) is represented by its IEEE 754 binary representation. All other values are represented as an IEEE 754 binary representation of NaN with bits 0-31 used as an ID and bits 32-34 used to differentiate between string, symbol, function and object.
typedef Type_
typedef Type_ = stdgo.GoInt;
Type represents the JavaScript type of a Value.