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
Copy file name to clipboardExpand all lines: js/js.go
+41-22Lines changed: 41 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,47 @@
1
-
// Package js provides functions for interacting with native JavaScript APIs. Calls to these functions are treated specially by GopherJS and translated directly to their corresponding JavaScript syntax.
1
+
// Package js provides functions for interacting with native JavaScript APIs.
2
+
// Calls to these functions are treated specially by GopherJS and translated
3
+
// directly to their corresponding JavaScript syntax.
2
4
//
3
-
// Use MakeWrapper to expose methods to JavaScript. When passing values directly, the following type conversions are performed:
5
+
// Use MakeWrapper to expose methods to JavaScript.
4
6
//
5
-
// | Go type | JavaScript type | Conversions back to interface{} |
// Any source values not listed in this table cause a runtime panic for a given
29
+
// target type if a conversion is attempted, e.g. a Javascript number value
30
+
// being assigned to a string type Go variable.
31
+
//
32
+
// Source values annotated with † are generally applicable to all valid
33
+
// values of the target type. e.g. for target type string, "ok" represents
34
+
// all valid string values.
35
+
//
36
+
// Externalization
37
+
//
38
+
// When values pass from Go to Javascript, a process known as externalization,
39
+
// the following conversion table is applied:
40
+
//
41
+
// To follow
42
+
//
43
+
// Additionally, for a struct containing a *js.Object field, only the content
44
+
// of the field will be passed to JavaScript and vice versa.
26
45
package js
27
46
28
47
// Object is a container for a native JavaScript object. Calls to its methods are treated specially by GopherJS and translated directly to their JavaScript syntax. A nil pointer to Object is equal to JavaScript's "null". Object can not be used as a map key.
0 commit comments