6
6
* The closure_compiler() method in tools/shared.py refers to this file when calling closure.
7
7
*/
8
8
9
- // Closure externs used by library_uuid.js
10
-
11
- /**
12
- * @param {Array } typedArray
13
- */
14
- crypto . getRandomValues = function ( typedArray ) { } ;
15
-
16
- /**
17
- BEGIN_NODE_INCLUDE
18
- var crypto = require('crypto');
19
- END_NODE_INCLUDE
20
- */
21
-
22
- /**
23
- * @type {Object.<string,*> }
24
- */
25
- var crypto = { } ;
26
-
27
- /**
28
- * @param {number } size
29
- * @param {function(Error, buffer.Buffer) } callback
30
- */
31
- crypto . randomBytes = function ( size , callback ) { } ;
32
-
33
-
34
9
// Closure externs used by library_sockfs.js
35
10
36
11
/**
@@ -107,93 +82,12 @@ var flags = {};
107
82
*/
108
83
flags . binary ;
109
84
110
-
111
- /**
112
- * @fileoverview Definitions for W3C's Gamepad specification.
113
- * @see http://www.w3.org/TR/gamepad/
114
- * @externs
115
- */
116
-
117
- /**
118
- * @typedef {{id: string, index: number, timestamp: number, axes: Array.<number>, buttons: Array.<number>} }
119
- */
120
- var Gamepad ;
121
-
122
- /**
123
- * @type {Array.<number> }
124
- */
125
- Gamepad . buttons ;
126
-
127
- /**
128
- * @type {Array.<number> }
129
- */
130
- Gamepad . axes ;
131
-
132
- /**
133
- * @type {number }
134
- */
135
- Gamepad . index ;
136
-
137
- /**
138
- * @type {string }
139
- */
140
- Gamepad . id ;
141
-
142
- /**
143
- * @type {number }
144
- */
145
- Gamepad . timestamp ;
146
-
147
- /**
148
- * @return {Array.<Gamepad> }
149
- */
150
- navigator . getGamepads = function ( ) { } ;
151
-
152
- /**
153
- * @return {Array.<Gamepad> }
154
- */
155
- navigator . webkitGetGamepads = function ( ) { } ;
156
-
157
- /**
158
- * @return {Array.<Gamepad> }
159
- */
160
- navigator . webkitGamepads = function ( ) { } ;
161
-
162
- /**
163
- * @return {Array.<Gamepad> }
164
- */
165
- navigator . mozGamepads = function ( ) { } ;
166
-
167
- /**
168
- * @return {Array.<Gamepad> }
169
- */
170
- navigator . gamepads = function ( ) { } ;
171
-
172
85
/**
173
86
* Backported from latest closure...
174
87
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript
175
88
*/
176
89
Document . prototype . currentScript ;
177
90
178
- //Atomics library (not yet in latest closure):
179
- //See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics
180
- var Atomics ;
181
- Atomics . prototype . NOTEQUAL = - 1 ;
182
- Atomics . prototype . OK = 0 ;
183
- Atomics . prototype . TIMEDOUT = - 2 ;
184
- Atomics . prototype . add = function ( typedArray , index , value ) { } ;
185
- Atomics . prototype . and = function ( typedArray , index , value ) { } ;
186
- Atomics . prototype . compareExchange = function ( typedArray , index , expectedValue , replacementValue ) { } ;
187
- Atomics . prototype . exchange = function ( typedArray , index , value ) { } ;
188
- Atomics . prototype . load = function ( typedArray , index ) { } ;
189
- Atomics . prototype . or = function ( typedArray , index , value ) { } ;
190
- Atomics . prototype . store = function ( typedArray , index , value ) { } ;
191
- Atomics . prototype . sub = function ( typedArray , index , value ) { } ;
192
- Atomics . prototype . xor = function ( typedArray , index , value ) { } ;
193
- Atomics . prototype . wait = function ( typedArray , index , valuei , timeout ) { } ;
194
- Atomics . prototype . wake = function ( typedArray , index , value ) { } ;
195
- Atomics . prototype . isLockFree = function ( size ) { } ;
196
-
197
91
/**
198
92
* SIMD.js support (not in upstream closure yet).
199
93
*/
@@ -918,7 +812,7 @@ var WebAssembly = {};
918
812
* @param {!BufferSource } bytes
919
813
*/
920
814
WebAssembly . Module = function ( bytes ) { } ;
921
- /**
815
+ /**
922
816
* @constructor
923
817
* @param {!WebAssembly.Module } moduleObject
924
818
* @param {Object= } importObject
@@ -978,7 +872,7 @@ WebAssembly.validate = function(bytes) {};
978
872
* @return {!Array<{name:string, kind:string}> }
979
873
*/
980
874
WebAssembly . Module . exports = function ( moduleObject ) { } ;
981
- /**
875
+ /**
982
876
* @param {!WebAssembly.Module } moduleObject
983
877
* @return {!Array<{module:string, name:string, kind:string}> }
984
878
*/
@@ -991,7 +885,7 @@ WebAssembly.Module.imports = function(moduleObject) {};
991
885
WebAssembly . Module . customSections = function ( moduleObject , sectionName ) { } ;
992
886
/** @dict */
993
887
WebAssembly . Instance . prototype . exports ;
994
- /**
888
+ /**
995
889
* @param {number } delta
996
890
* @return {number }
997
891
*/
@@ -1019,3 +913,190 @@ WebAssembly.Table.prototype.get = function(index) {};
1019
913
* @param {?function(...) } value
1020
914
*/
1021
915
WebAssembly . Table . prototype . set = function ( index , value ) { } ;
916
+
917
+ // Random SpiderMonkey/V8 externs
918
+
919
+ /**
920
+ * @param {string } filename
921
+ * @param {string } type
922
+ * @return {string }
923
+ */
924
+ var read = function ( filename , type ) { } ;
925
+ /**
926
+ * @param {string } expression
927
+ */
928
+ var print = function ( expression ) { } ;
929
+ /**
930
+ * @param {string } expression
931
+ */
932
+ var printErr = function ( expression ) { } ;
933
+ /**
934
+ * @param {string } filename
935
+ * @return {ArrayBuffer }
936
+ */
937
+ var readbuffer = function ( filename ) { } ;
938
+ /**
939
+ * @const
940
+ */
941
+ var scriptArgs = [ ] ;
942
+ /**
943
+ * @const
944
+ */
945
+ var quit = function ( ) { } ;
946
+ /**
947
+ * @return {number }
948
+ */
949
+ var dateNow = function ( ) { } ;
950
+
951
+ // WebIDL
952
+
953
+ /**
954
+ * @suppress {duplicate}
955
+ */
956
+ var WrapperObject ;
957
+ /**
958
+ * @suppress {duplicate}
959
+ */
960
+ var getCache ;
961
+ /**
962
+ * @suppress {duplicate}
963
+ */
964
+ var wrapPointer ;
965
+ /**
966
+ * @suppress {duplicate}
967
+ */
968
+ var castObject ;
969
+ /**
970
+ * @suppress {duplicate}
971
+ */
972
+ var destroy ;
973
+ /**
974
+ * @suppress {duplicate}
975
+ */
976
+ var compare ;
977
+ /**
978
+ * @suppress {duplicate}
979
+ */
980
+ var getPointer ;
981
+ /**
982
+ * @suppress {duplicate}
983
+ */
984
+ var getClass ;
985
+ /**
986
+ * @suppress {duplicate}
987
+ */
988
+ var ensureCache ;
989
+ /**
990
+ * @suppress {duplicate}
991
+ */
992
+ var ensureString ;
993
+ /**
994
+ * @suppress {duplicate}
995
+ */
996
+ var ensureInt8 ;
997
+ /**
998
+ * @suppress {duplicate}
999
+ */
1000
+ var ensureInt16 ;
1001
+ /**
1002
+ * @suppress {duplicate}
1003
+ */
1004
+ var ensureInt32 ;
1005
+ /**
1006
+ * @suppress {duplicate}
1007
+ */
1008
+ var ensureFloat32 ;
1009
+ /**
1010
+ * @suppress {duplicate}
1011
+ */
1012
+ var ensureFloat64 ;
1013
+ /**
1014
+ * @suppress {duplicate}
1015
+ */
1016
+ var VoidPtr ;
1017
+
1018
+
1019
+ // Various Emscripten-specific global variables
1020
+
1021
+ var tempRet0 ;
1022
+ var tempI64 ;
1023
+ var tempDouble ;
1024
+ /**
1025
+ * @suppress {duplicate}
1026
+ */
1027
+ var WasmJS ;
1028
+ /**
1029
+ * @suppress {duplicate}
1030
+ */
1031
+ var Module ;
1032
+
1033
+ // Various variables that get into WasmJS of Binaryen, but are not present in final build and never actually used (should probably be fixed in future)
1034
+ // These are only needed for `interpret-asm2wasm` and not for `asmjs` or `native-wasm`
1035
+
1036
+ /**
1037
+ * @suppress {duplicate}
1038
+ */
1039
+ var Browser ;
1040
+ /**
1041
+ * @suppress {duplicate}
1042
+ */
1043
+ var SOCKFS = { } ;
1044
+ /**
1045
+ * @suppress {duplicate}
1046
+ */
1047
+ var __read_sockaddr = function ( addrp , addrlen ) { } ;
1048
+ /**
1049
+ * @suppress {duplicate}
1050
+ */
1051
+ var DNS = { } ;
1052
+ /**
1053
+ * @suppress {duplicate}
1054
+ */
1055
+ var FS ;
1056
+ /**
1057
+ * @suppress {undefinedVars}
1058
+ */
1059
+ var wakaUnknownAfter ;
1060
+ /**
1061
+ * @suppress {undefinedVars}
1062
+ */
1063
+ var wakaUnknownBefore ;
1064
+ /**
1065
+ * @suppress {duplicate}
1066
+ */
1067
+ var env ;
1068
+ /**
1069
+ * @suppress {duplicate}
1070
+ */
1071
+ var ___cxa_free_exception = function ( ) { } ;
1072
+
1073
+ // On top of node externs to avoid some `declared more than once` errors
1074
+
1075
+ /**
1076
+ * @suppress {duplicate}
1077
+ */
1078
+ var assert ;
1079
+ /**
1080
+ * @suppress {duplicate}
1081
+ */
1082
+ var buffer ;
1083
+ /**
1084
+ * @suppress {duplicate}
1085
+ */
1086
+ var fs ;
1087
+ /**
1088
+ * @suppress {undefinedVars}
1089
+ */
1090
+ var FUNCTION_TABLE ;
1091
+ /**
1092
+ * @suppress {undefinedVars}
1093
+ */
1094
+ var MozBlobBuilder ;
1095
+ /**
1096
+ * @suppress {undefinedVars}
1097
+ */
1098
+ var GL ;
1099
+ /**
1100
+ * @suppress {undefinedVars}
1101
+ */
1102
+ var SDL ;
0 commit comments