diff --git a/emcc.py b/emcc.py index fbbf0dde240ca..feb779dfca34b 100755 --- a/emcc.py +++ b/emcc.py @@ -1519,7 +1519,6 @@ def is_supported_link_flag(f): 'getMemory', 'addRunDependency', 'removeRunDependency', - 'calledRun', ] if shared.Settings.USE_PTHREADS: diff --git a/src/base64Utils.js b/src/base64Utils.js index 557368f73b0af..1887d75a71693 100644 --- a/src/base64Utils.js +++ b/src/base64Utils.js @@ -6,7 +6,7 @@ /** * Decodes a base64 string. - * @param {String} input The string to decode. + * @param {string} input The string to decode. */ var decodeBase64 = typeof atob === 'function' ? atob : function (input) { var keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; @@ -46,11 +46,13 @@ function intArrayFromBase64(s) { if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) { var buf; try { + // TODO: Update Node.js externs, Closure does not recognize the following Buffer.from() + /**@suppress{checkTypes}*/ buf = Buffer.from(s, 'base64'); } catch (_) { buf = new Buffer(s, 'base64'); } - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']); } #endif diff --git a/src/closure-externs/node-externs.js b/src/closure-externs/node-externs.js index 849f533f8659d..8ea7082789012 100644 --- a/src/closure-externs/node-externs.js +++ b/src/closure-externs/node-externs.js @@ -83,7 +83,7 @@ var Buffer = function(var_args) {}; * @param {ArrayBuffer|SharedArrayBuffer} arrayBuffer * @param {number=} byteOffset * @param {number=} length - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} * @nosideeffects */ Buffer.from = function(arrayBuffer, byteOffset, length) {}; diff --git a/src/embind/embind.js b/src/embind/embind.js index 280e8f55272d3..98266fb058e9f 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -126,6 +126,7 @@ var LibraryEmbind = { the appropriate overload to call from an function overload table. This selector function is only used if multiple overloads are actually registered, since it carries a slight performance penalty. */ $exposePublicSymbol__deps: ['$ensureOverloadTable', '$throwBindingError'], + $exposePublicSymbol__docs: '/** @param {number=} numArguments */', $exposePublicSymbol: function(name, value, numArguments) { if (Module.hasOwnProperty(name)) { if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) { @@ -150,6 +151,7 @@ var LibraryEmbind = { }, $replacePublicSymbol__deps: ['$throwInternalError'], + $replacePublicSymbol__docs: '/** @param {number=} numArguments */', $replacePublicSymbol: function(name, value, numArguments) { if (!Module.hasOwnProperty(name)) { throwInternalError('Replacing nonexistant public symbol'); @@ -298,6 +300,7 @@ var LibraryEmbind = { '$awaitingDependencies', '$registeredTypes', '$typeDependencies', '$throwBindingError', '$whenDependentTypesAreResolved'], + $registerType__docs: '/** @param {Object=} options */', $registerType: function(rawType, registeredInstance, options) { options = options || {}; @@ -852,7 +855,7 @@ var LibraryEmbind = { var heap = HEAPU32; var size = heap[handle]; // in elements var data = heap[handle + 1]; // byte offset into emscripten heap - return new TA(heap['buffer'], data, size); + return new TA(buffer, data, size); } name = readLatin1String(name); @@ -1498,6 +1501,14 @@ var LibraryEmbind = { RegisteredPointer.prototype['fromWireType'] = RegisteredPointer_fromWireType; }, + $RegisteredPointer__docs: `/** @constructor + @param {*=} pointeeType, + @param {*=} sharingPolicy, + @param {*=} rawGetPointee, + @param {*=} rawConstructor, + @param {*=} rawShare, + @param {*=} rawDestructor, + */`, $RegisteredPointer__deps: [ '$constNoSmartPtrRawPointerToWireType', '$genericPointerToWireType', '$nonConstNoSmartPtrRawPointerToWireType', '$init_RegisteredPointer'], @@ -1852,6 +1863,7 @@ var LibraryEmbind = { } }, + $RegisteredClass__docs: '/** @constructor */', $RegisteredClass: function( name, constructor, diff --git a/src/embind/emval.js b/src/embind/emval.js index adacd66b16a83..82703a85bb976 100644 --- a/src/embind/emval.js +++ b/src/embind/emval.js @@ -331,7 +331,7 @@ var LibraryEmVal = { }, _emval_lookupTypes__deps: ['$requireRegisteredType'], - _emval_lookupTypes: function(argCount, argTypes, argWireTypes) { + _emval_lookupTypes: function(argCount, argTypes) { var a = new Array(argCount); for (var i = 0; i < argCount; ++i) { a[i] = requireRegisteredType( diff --git a/src/library.js b/src/library.js index f546d1d98e172..ddba99ced08d9 100644 --- a/src/library.js +++ b/src/library.js @@ -497,7 +497,7 @@ LibraryManager.library = { #else // asm.js: var newBuffer = new ArrayBuffer(size); if (newBuffer.byteLength != size) return /*undefined, allocation did not succeed*/; - new Int8Array(newBuffer).set(HEAP8); + new Int8Array(newBuffer).set(/**@type{!Int8Array}*/(HEAP8)); _emscripten_replace_memory(newBuffer); updateGlobalBufferAndViews(newBuffer); #endif diff --git a/src/library_html5.js b/src/library_html5.js index 6cb4bc16bcdf5..0d9bee7fb3f2e 100644 --- a/src/library_html5.js +++ b/src/library_html5.js @@ -1016,7 +1016,7 @@ var LibraryJSEvents = { emscripten_set_orientationchange_callback_on_thread__sig: 'iiiii', emscripten_set_orientationchange_callback_on_thread__deps: ['_registerOrientationChangeEventCallback'], emscripten_set_orientationchange_callback_on_thread: function(userData, useCapture, callbackfunc, targetThread) { - if (!screen || !screen.addEventListener) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}}; + if (!screen || !screen['addEventListener']) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}}; __registerOrientationChangeEventCallback(screen, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_ORIENTATIONCHANGE') }}}, "orientationchange", targetThread); return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}}; }, diff --git a/src/library_syscall.js b/src/library_syscall.js index 741c74f7f88fe..259a43e6a0db0 100644 --- a/src/library_syscall.js +++ b/src/library_syscall.js @@ -892,17 +892,24 @@ var SyscallsLibrary = { __syscall150__nothrow: true, __syscall150__proxy: false, __syscall150__sig: 'iii', - __syscall150: '__syscall153', // mlock + __syscall150: function(addr, len) { // mlock + return 0; + }, __syscall151__nothrow: true, __syscall151__proxy: false, __syscall151__sig: 'iii', - __syscall151: '__syscall153', // munlock + __syscall151: function(addr, len) { // munlock + return 0; + }, __syscall152__nothrow: true, __syscall152__proxy: false, - __syscall152__sig: 'iii', - __syscall152: '__syscall153', // mlockall + __syscall152__sig: 'ii', + __syscall152: function(flags) { // mlockall + return 0; + }, __syscall153__nothrow: true, __syscall153__proxy: false, + __syscall153__sig: 'i', __syscall153: function() { // munlockall return 0; }, @@ -983,11 +990,11 @@ var SyscallsLibrary = { return 0; }, __syscall195: function(path, buf) { // SYS_stat64 - var path = SYSCALLS.getStr(path); + path = SYSCALLS.getStr(path); return SYSCALLS.doStat(FS.stat, path, buf); }, __syscall196: function(path, buf) { // SYS_lstat64 - var path = SYSCALLS.getStr(path); + path = SYSCALLS.getStr(path); return SYSCALLS.doStat(FS.lstat, path, buf); }, __syscall197: function(fd, buf) { // SYS_fstat64 @@ -1194,7 +1201,7 @@ var SyscallsLibrary = { return 0; }, __syscall268: function(path, size, buf) { // statfs64 - var path = SYSCALLS.getStr(path); + path = SYSCALLS.getStr(path); #if ASSERTIONS assert(size === {{{ C_STRUCTS.statfs.__size__ }}}); #endif @@ -1735,7 +1742,11 @@ for (var x in SyscallsLibrary) { } #if SYSCALL_DEBUG if (which && t.indexOf(', varargs') != -1) { - post += 'SYSCALLS.varargs = undefined;\n'; + if (canThrow) { + post += 'finally { SYSCALLS.varargs = undefined; }\n'; + } else { + post += 'SYSCALLS.varargs = undefined;\n'; + } } if (which) { pre += "err('syscall! ' + [" + which + ", '" + SYSCALL_CODE_TO_NAME[which] + "']);\n"; diff --git a/src/modules.js b/src/modules.js index e09e3104fd883..5491915ae1cee 100644 --- a/src/modules.js +++ b/src/modules.js @@ -330,8 +330,7 @@ function isExportedByForceFilesystem(name) { name === 'FS_unlink' || name === 'getMemory' || name === 'addRunDependency' || - name === 'removeRunDependency' || - name === 'calledRun'; + name === 'removeRunDependency'; } // export parts of the JS runtime that the user asked for @@ -508,7 +507,6 @@ function exportRuntime() { 'ALLOC_STACK', 'ALLOC_DYNAMIC', 'ALLOC_NONE', - 'calledRun', ]; if (ASSERTIONS) { // check all exported things exist, warn about typos diff --git a/src/postamble.js b/src/postamble.js index de2634d1014de..bf7f53ff0f550 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -306,9 +306,7 @@ function run(args) { // or while the async setStatus time below was happening if (calledRun) return; calledRun = true; -#if 'calledRun' in EXPORTED_RUNTIME_METHODS_SET Module['calledRun'] = true; -#endif if (ABORT) return; @@ -374,10 +372,11 @@ function checkUnflushedContent() { try { // it doesn't matter if it fails #if SYSCALLS_REQUIRE_FILESYSTEM == 0 var flush = {{{ '$flush_NO_FILESYSTEM' in addedLibraryItems ? 'flush_NO_FILESYSTEM' : 'null' }}}; + if (flush) flush(); #else var flush = Module['_fflush']; -#endif if (flush) flush(0); +#endif #if '$FS' in addedLibraryItems && '$TTY' in addedLibraryItems // also flush in the JS FS layer ['stdout', 'stderr'].forEach(function(name) { diff --git a/src/preamble.js b/src/preamble.js index 56ad7b6311503..009000ea2fad3 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -97,6 +97,9 @@ function getCFunc(ident) { } // C calling interface. +/** @param {Array=} argTypes + @param {Arguments|Array=} args + @param {Object=} opts */ function ccall(ident, returnType, argTypes, args, opts) { // For fast lookup of conversion functions var toC = { @@ -189,6 +192,8 @@ function ccall(ident, returnType, argTypes, args, opts) { return ret; } +/** @param {Array=} argTypes + @param {Object=} opts */ function cwrap(ident, returnType, argTypes, opts) { #if !ASSERTIONS argTypes = argTypes || []; diff --git a/src/runtime_safe_heap.js b/src/runtime_safe_heap.js index 4d1cd49ce56b7..05ba508e04b48 100644 --- a/src/runtime_safe_heap.js +++ b/src/runtime_safe_heap.js @@ -2,7 +2,10 @@ // In MINIMAL_RUNTIME, setValue() and getValue() are only available when building with safe heap enabled, for heap safety checking. // In traditional runtime, setValue() and getValue() are always available (although their use is highly discouraged due to perf penalties) -/** @type {function(number, number, string, boolean=)} */ +/** @param {number} ptr + @param {number} value + @param {string} type + @param {number|boolean=} noSafe */ function setValue(ptr, value, type, noSafe) { type = type || 'i8'; if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit @@ -35,7 +38,9 @@ function setValue(ptr, value, type, noSafe) { #endif } -/** @type {function(number, string, boolean=)} */ +/** @param {number} ptr + @param {string} type + @param {number|boolean=} noSafe */ function getValue(ptr, type, noSafe) { type = type || 'i8'; if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit @@ -72,6 +77,7 @@ function getValue(ptr, type, noSafe) { #if SAFE_HEAP +/** @param {number|boolean=} isFloat */ function getSafeHeapType(bytes, isFloat) { switch (bytes) { case 1: return 'i8'; @@ -86,6 +92,7 @@ function getSafeHeapType(bytes, isFloat) { var SAFE_HEAP_COUNTER = 0; #endif +/** @param {number|boolean=} isFloat */ function SAFE_HEAP_STORE(dest, value, bytes, isFloat) { #if SAFE_HEAP_LOG out('SAFE_HEAP store: ' + [dest, value, bytes, isFloat, SAFE_HEAP_COUNTER++]); @@ -101,6 +108,7 @@ function SAFE_HEAP_STORE_D(dest, value, bytes) { SAFE_HEAP_STORE(dest, value, bytes, true); } +/** @param {number|boolean=} isFloat */ function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) { if (dest <= 0) abort('segmentation fault loading ' + bytes + ' bytes from address ' + dest); if (dest % bytes !== 0) abort('alignment error loading from address ' + dest + ', which was expected to be aligned to a multiple of ' + bytes); @@ -109,7 +117,7 @@ function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) { assert(HEAP32[DYNAMICTOP_PTR>>2] <= HEAP8.length); var type = getSafeHeapType(bytes, isFloat); var ret = getValue(dest, type, 1); - if (unsigned) ret = unSign(ret, parseInt(type.substr(1)), 1); + if (unsigned) ret = unSign(ret, parseInt(type.substr(1), 10), 1); #if SAFE_HEAP_LOG out('SAFE_HEAP load: ' + [dest, ret, bytes, isFloat, unsigned, SAFE_HEAP_COUNTER++]); #endif diff --git a/tests/Module-exports/setup.js b/tests/Module-exports/setup.js index cc51dfe246355..2d273c7b1dd71 100644 --- a/tests/Module-exports/setup.js +++ b/tests/Module-exports/setup.js @@ -8,6 +8,7 @@ * prevents the runtime exiting. This is necessary as otherwise things like * printf don't seem to work from methods called by JavaScript. */ +/** @suppress{checkTypes} */ Module = { 'noExitRuntime' : true }; diff --git a/tests/test_core.py b/tests/test_core.py index f92eef823e009..8ff435e46332b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4891,6 +4891,7 @@ def test_files(self): print('base', self.emcc_args) create_test_file('pre.js', ''' +/** @suppress{checkTypes}*/ Module = { 'noFSInit': true, 'preRun': function() { diff --git a/third_party/closure-compiler/node-externs/buffer.js b/third_party/closure-compiler/node-externs/buffer.js index 0648124c202bb..6ef3e9e9589d5 100644 --- a/third_party/closure-compiler/node-externs/buffer.js +++ b/third_party/closure-compiler/node-externs/buffer.js @@ -24,7 +24,7 @@ /** BEGIN_NODE_INCLUDE - var buffer = require('buffer'); + var nodeBuffer = require('buffer'); END_NODE_INCLUDE */ @@ -32,27 +32,27 @@ * @type {Object.} * @suppress {duplicate} */ -var buffer = {}; +var nodeBuffer = {}; /** * @param {...*} var_args * @constructor * @nosideeffects */ -buffer.Buffer = function(var_args) {}; +nodeBuffer.Buffer = function(var_args) {}; /** * @param {string} encoding * @return {boolean} */ -buffer.Buffer.isEncoding = function(encoding) {}; +nodeBuffer.Buffer.isEncoding = function(encoding) {}; /** * @param {*} obj * @return {boolean} * @nosideeffects */ -buffer.Buffer.isBuffer = function(obj) {}; +nodeBuffer.Buffer.isBuffer = function(obj) {}; /** * @param {string} string @@ -60,27 +60,27 @@ buffer.Buffer.isBuffer = function(obj) {}; * @return {number} * @nosideeffects */ -buffer.Buffer.byteLength = function(string, encoding) {}; +nodeBuffer.Buffer.byteLength = function(string, encoding) {}; /** - * @param {Array.} list + * @param {Array.} list * @param {number=} totalLength - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} * @nosideeffects */ -buffer.Buffer.concat = function(list, totalLength) {}; +nodeBuffer.Buffer.concat = function(list, totalLength) {}; /** * @param {number} offset * @return {*} */ -buffer.Buffer.prototype.get = function(offset) {}; +nodeBuffer.Buffer.prototype.get = function(offset) {}; /** * @param {number} offset * @param {*} v */ -buffer.Buffer.prototype.set = function(offset, v) {}; +nodeBuffer.Buffer.prototype.set = function(offset, v) {}; /** * @param {string} string @@ -89,132 +89,132 @@ buffer.Buffer.prototype.set = function(offset, v) {}; * @param {number|string=} encoding * @return {*} */ -buffer.Buffer.prototype.write = function(string, offset, length, encoding) {}; +nodeBuffer.Buffer.prototype.write = function(string, offset, length, encoding) {}; /** * @return {Array} */ -buffer.Buffer.prototype.toJSON = function() {}; +nodeBuffer.Buffer.prototype.toJSON = function() {}; /** * @type {number} */ -buffer.Buffer.prototype.length; +nodeBuffer.Buffer.prototype.length; /** - * @param {buffer.Buffer} targetBuffer + * @param {nodeBuffer.Buffer} targetBuffer * @param {number=} targetStart * @param {number=} sourceStart * @param {number=} sourceEnd - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.copy = function(targetBuffer, targetStart, sourceStart, sourceEnd){}; +nodeBuffer.Buffer.prototype.copy = function(targetBuffer, targetStart, sourceStart, sourceEnd){}; /** * @param {number=} start * @param {number=} end - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} * @nosideeffects */ -buffer.Buffer.prototype.slice = function(start, end) {}; +nodeBuffer.Buffer.prototype.slice = function(start, end) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readUInt8 = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readUInt8 = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readUInt16LE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readUInt16LE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readUInt16BE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readUInt16BE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readUInt32LE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readUInt32LE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readUInt32BE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readUInt32BE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readInt8 = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readInt8 = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readInt16LE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readInt16LE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readInt16BE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readInt16BE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readInt32LE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readInt32LE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readInt32BE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readInt32BE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readFloatLE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readFloatLE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readFloatBE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readFloatBE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readDoubleLE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readDoubleLE = function(offset, noAssert) {}; /** * @param {number} offset * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.readDoubleBE = function(offset, noAssert) {}; +nodeBuffer.Buffer.prototype.readDoubleBE = function(offset, noAssert) {}; /** * @param {number} value @@ -222,7 +222,7 @@ buffer.Buffer.prototype.readDoubleBE = function(offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {}; /** * @param {number} value @@ -230,7 +230,7 @@ buffer.Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -238,7 +238,7 @@ buffer.Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -246,7 +246,7 @@ buffer.Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -254,7 +254,7 @@ buffer.Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -262,7 +262,7 @@ buffer.Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeInt8 = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeInt8 = function(value, offset, noAssert) {}; /** * @param {number} value @@ -270,7 +270,7 @@ buffer.Buffer.prototype.writeInt8 = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeInt16LE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeInt16LE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -278,7 +278,7 @@ buffer.Buffer.prototype.writeInt16LE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeInt16BE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeInt16BE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -286,7 +286,7 @@ buffer.Buffer.prototype.writeInt16BE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeInt32LE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeInt32LE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -294,7 +294,7 @@ buffer.Buffer.prototype.writeInt32LE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -302,7 +302,7 @@ buffer.Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -310,7 +310,7 @@ buffer.Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -318,7 +318,7 @@ buffer.Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {}; /** * @param {number} value @@ -326,14 +326,14 @@ buffer.Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {}; * @param {boolean=} noAssert * @return {number} */ -buffer.Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {}; +nodeBuffer.Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {}; /** * @param {*} value * @param {number=} offset * @param {number=} end */ -buffer.Buffer.prototype.fill = function(value, offset, end) {}; +nodeBuffer.Buffer.prototype.fill = function(value, offset, end) {}; /** * @param {string=} encoding @@ -341,17 +341,17 @@ buffer.Buffer.prototype.fill = function(value, offset, end) {}; * @param {number=} end * @nosideeffects */ -buffer.Buffer.prototype.toString = function(encoding, start, end) {}; +nodeBuffer.Buffer.prototype.toString = function(encoding, start, end) {}; /** * @type {number} */ -buffer.Buffer.INSPECT_MAX_BYTES = 50; +nodeBuffer.Buffer.INSPECT_MAX_BYTES = 50; /** * @param {number} size */ -buffer.SlowBuffer = function(size) {}; +nodeBuffer.SlowBuffer = function(size) {}; /** * @@ -361,19 +361,19 @@ buffer.SlowBuffer = function(size) {}; * @param {number|string=} encoding * @return {*} */ -buffer.SlowBuffer.prototype.write = function(string, offset, length, encoding) {}; +nodeBuffer.SlowBuffer.prototype.write = function(string, offset, length, encoding) {}; /** * @param {number} start * @param {number} end - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.SlowBuffer.prototype.slice = function(start, end) {}; +nodeBuffer.SlowBuffer.prototype.slice = function(start, end) {}; /** * @return {string} */ -buffer.SlowBuffer.prototype.toString = function() {}; +nodeBuffer.SlowBuffer.prototype.toString = function() {}; // // Legacy @@ -382,41 +382,41 @@ buffer.SlowBuffer.prototype.toString = function() {}; /** * @param {number=} start * @param {number=} end - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.utf8Slice = function(start, end) {}; +nodeBuffer.Buffer.prototype.utf8Slice = function(start, end) {}; /** * @param {number=} start * @param {number=} end - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.binarySlice = function(start, end) {}; +nodeBuffer.Buffer.prototype.binarySlice = function(start, end) {}; /** * @param {number=} start * @param {number=} end - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.asciiSlice = function(start, end) {}; +nodeBuffer.Buffer.prototype.asciiSlice = function(start, end) {}; /** * @param {string} string * @param {number=} offset - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.utf8Write = function(string, offset) {}; +nodeBuffer.Buffer.prototype.utf8Write = function(string, offset) {}; /** * @param {string} string * @param {number=} offset - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.binaryWrite = function(string, offset) {}; +nodeBuffer.Buffer.prototype.binaryWrite = function(string, offset) {}; /** * @param {string} string * @param {number=} offset - * @return {buffer.Buffer} + * @return {nodeBuffer.Buffer} */ -buffer.Buffer.prototype.asciiWrite = function(string, offset) {}; +nodeBuffer.Buffer.prototype.asciiWrite = function(string, offset) {}; diff --git a/third_party/closure-compiler/node-externs/child_process.js b/third_party/closure-compiler/node-externs/child_process.js index d8819323de5f0..6c9eea5aef882 100644 --- a/third_party/closure-compiler/node-externs/child_process.js +++ b/third_party/closure-compiler/node-externs/child_process.js @@ -90,8 +90,8 @@ child_process.ChildProcess.spawn = function(command, args, options) {}; /** * @param {string} command - * @param {child_process.Options|function(Error, buffer.Buffer, buffer.Buffer)=} options - * @param {function(Error, buffer.Buffer, buffer.Buffer)=} callback + * @param {child_process.Options|function(Error, nodeBuffer.Buffer, nodeBuffer.Buffer)=} options + * @param {function(Error, nodeBuffer.Buffer, nodeBuffer.Buffer)=} callback * @return {child_process.ChildProcess} */ child_process.exec = function(command, options, callback) {}; @@ -100,7 +100,7 @@ child_process.exec = function(command, options, callback) {}; * @param {string} file * @param {Array.} args * @param {child_process.Options} options - * @param {function(Error, buffer.Buffer, buffer.Buffer)} callback + * @param {function(Error, nodeBuffer.Buffer, nodeBuffer.Buffer)} callback * @return {child_process.ChildProcess} */ child_process.execFile = function(file, args, options, callback) {}; diff --git a/third_party/closure-compiler/node-externs/dgram.js b/third_party/closure-compiler/node-externs/dgram.js index 45e3322c98cef..2c59d96209227 100644 --- a/third_party/closure-compiler/node-externs/dgram.js +++ b/third_party/closure-compiler/node-externs/dgram.js @@ -47,7 +47,7 @@ dgram.createSocket = function(type, callback) {}; dgram.Socket = function() {}; /** - * @param {buffer.Buffer} buf + * @param {nodeBuffer.Buffer} buf * @param {number} offset * @param {number} length * @param {number} port diff --git a/third_party/closure-compiler/node-externs/fs.js b/third_party/closure-compiler/node-externs/fs.js index be64556a492ce..1eb4d87bf3e50 100644 --- a/third_party/closure-compiler/node-externs/fs.js +++ b/third_party/closure-compiler/node-externs/fs.js @@ -397,15 +397,15 @@ fs.readSync = function(fd, buffer, offset, length, position) {}; /** * @param {string} filename - * @param {string|{encoding:(string|undefined),flag:(string|undefined)}|function(string, (string|buffer.Buffer))=} encodingOrOptions - * @param {function(string, (string|buffer.Buffer))=} callback + * @param {string|{encoding:(string|undefined),flag:(string|undefined)}|function(string, (string|nodeBuffer.Buffer))=} encodingOrOptions + * @param {function(string, (string|nodeBuffer.Buffer))=} callback */ fs.readFile = function(filename, encodingOrOptions, callback) {}; /** * @param {string} filename * @param {string|{encoding:(string|undefined),flag:(string|undefined)}=} encodingOrOptions - * @return {string|buffer.Buffer} + * @return {string|nodeBuffer.Buffer} * @nosideeffects */ fs.readFileSync = function(filename, encodingOrOptions) {}; diff --git a/third_party/closure-compiler/node-externs/http.js b/third_party/closure-compiler/node-externs/http.js index fa36537aba76f..0e05ad4aa5af8 100644 --- a/third_party/closure-compiler/node-externs/http.js +++ b/third_party/closure-compiler/node-externs/http.js @@ -161,7 +161,7 @@ http.ServerResponse.prototype.getHeader = function(name) {}; http.ServerResponse.prototype.removeHeader = function(name) {}; /** - * @param {string|Array|buffer.Buffer} chunk + * @param {string|Array|nodeBuffer.Buffer} chunk * @param {string=} encoding */ http.ServerResponse.prototype.write = function(chunk, encoding) {}; @@ -172,7 +172,7 @@ http.ServerResponse.prototype.write = function(chunk, encoding) {}; http.ServerResponse.prototype.addTrailers = function(headers) {}; /** - * @param {(string|Array|buffer.Buffer)=} data + * @param {(string|Array|nodeBuffer.Buffer)=} data * @param {string=} encoding */ http.ServerResponse.prototype.end = function(data, encoding) {}; @@ -185,13 +185,13 @@ http.ServerResponse.prototype.end = function(data, encoding) {}; http.ClientRequest = function() {}; /** - * @param {string|Array|buffer.Buffer} chunk + * @param {string|Array|nodeBuffer.Buffer} chunk * @param {string=} encoding */ http.ClientRequest.prototype.write = function(chunk, encoding) {}; /** - * @param {(string|Array|buffer.Buffer)=} data + * @param {(string|Array|nodeBuffer.Buffer)=} data * @param {string=} encoding */ http.ClientRequest.prototype.end = function(data, encoding) {}; diff --git a/third_party/closure-compiler/node-externs/https.js b/third_party/closure-compiler/node-externs/https.js index 8d129b33570ec..63652553a75c1 100644 --- a/third_party/closure-compiler/node-externs/https.js +++ b/third_party/closure-compiler/node-externs/https.js @@ -52,7 +52,7 @@ https.Server.prototype.close = function(callback) {}; https.createServer = function(options, requestListener) {}; /** - * @typedef {{host: ?string, hostname: ?string, port: ?number, method: ?string, path: ?string, headers: ?Object., auth: ?string, agent: ?(https.Agent|boolean), pfx: ?(string|buffer.Buffer), key: ?(string|buffer.Buffer), passphrase: ?string, cert: ?(string|buffer.Buffer), ca: ?Array., ciphers: ?string, rejectUnauthorized: ?boolean}} + * @typedef {{host: ?string, hostname: ?string, port: ?number, method: ?string, path: ?string, headers: ?Object., auth: ?string, agent: ?(https.Agent|boolean), pfx: ?(string|nodeBuffer.Buffer), key: ?(string|nodeBuffer.Buffer), passphrase: ?string, cert: ?(string|nodeBuffer.Buffer), ca: ?Array., ciphers: ?string, rejectUnauthorized: ?boolean}} */ https.ConnectOptions; diff --git a/third_party/closure-compiler/node-externs/net.js b/third_party/closure-compiler/node-externs/net.js index 57bf9d0ce1463..35fe096d2b81f 100644 --- a/third_party/closure-compiler/node-externs/net.js +++ b/third_party/closure-compiler/node-externs/net.js @@ -124,14 +124,14 @@ net.Socket.prototype.bufferSize; net.Socket.prototype.setEncoding = function(encoding) {}; /** - * @param {string|buffer.Buffer} data + * @param {string|nodeBuffer.Buffer} data * @param {(string|function(...))=}encoding * @param {function(...)=} callback */ net.Socket.prototype.write = function(data, encoding, callback) {}; /** - * @param {(string|buffer.Buffer)=}data + * @param {(string|nodeBuffer.Buffer)=}data * @param {string=} encoding */ net.Socket.prototype.end = function(data, encoding) {}; diff --git a/third_party/closure-compiler/node-externs/querystring.js b/third_party/closure-compiler/node-externs/querystring.js index 7c0c17adc6024..b9221568f6311 100644 --- a/third_party/closure-compiler/node-externs/querystring.js +++ b/third_party/closure-compiler/node-externs/querystring.js @@ -64,7 +64,7 @@ querystring.escape = function(str) {}; querystring.unescape = function(str) {}; /** - * @param {buffer.Buffer} s + * @param {nodeBuffer.Buffer} s * @param {boolean} decodeSpaces */ querystring.unescapeBuffer = function(s, decodeSpaces) {}; diff --git a/third_party/closure-compiler/node-externs/stream.js b/third_party/closure-compiler/node-externs/stream.js index c0a645c55af4a..4596a6b737249 100644 --- a/third_party/closure-compiler/node-externs/stream.js +++ b/third_party/closure-compiler/node-externs/stream.js @@ -80,13 +80,13 @@ stream.WritableStream.prototype.drain = function() {}; stream.WritableStream.prototype.writable; /** - * @param {string|buffer.Buffer} buffer + * @param {string|nodeBuffer.Buffer} buffer * @param {string=} encoding */ stream.WritableStream.prototype.write = function(buffer, encoding) {}; /** - * @param {string|buffer.Buffer=} buffer + * @param {string|nodeBuffer.Buffer=} buffer * @param {string=} encoding * @param {function(*=)=} cb */ @@ -117,13 +117,13 @@ stream.Readable.prototype.readable; /** * @protected - * @param {string|buffer.Buffer|null} chunk + * @param {string|nodeBuffer.Buffer|null} chunk * @return {boolean} */ stream.Readable.prototype.push = function(chunk) {}; /** - * @param {string|buffer.Buffer|null} chunk + * @param {string|nodeBuffer.Buffer|null} chunk * @return {boolean} */ stream.Readable.prototype.unshift = function(chunk) {}; @@ -135,7 +135,7 @@ stream.Readable.prototype.setEncoding = function(enc) {}; /** * @param {number=} n - * @return {buffer.Buffer|string|null} + * @return {nodeBuffer.Buffer|string|null} */ stream.Readable.prototype.read = function(n) {}; @@ -179,7 +179,7 @@ stream.Writable = function(options) {}; stream.Writable.prototype.writable; /** - * @param {string|buffer.Buffer} chunk + * @param {string|nodeBuffer.Buffer} chunk * @param {string=} encoding * @param {function(*=)=} cb * @return {boolean} @@ -188,14 +188,14 @@ stream.Writable.prototype.write = function(chunk, encoding, cb) {}; /** * @protected - * @param {string|buffer.Buffer} chunk + * @param {string|nodeBuffer.Buffer} chunk * @param {string} encoding * @param {function(*=)} cb */ stream.Writable.prototype._write = function(chunk, encoding, cb) {}; /** - * @param {string|buffer.Buffer=} chunk + * @param {string|nodeBuffer.Buffer=} chunk * @param {string=} encoding * @param {function(*=)=} cb */ @@ -224,7 +224,7 @@ stream.Transform = function(options) {}; /** * @protected - * @param {string|buffer.Buffer} chunk + * @param {string|nodeBuffer.Buffer} chunk * @param {string} encoding * @param {function(*=)} cb */ diff --git a/third_party/closure-compiler/node-externs/string_decoder.js b/third_party/closure-compiler/node-externs/string_decoder.js index f96190a48feff..de49e2295fbcc 100644 --- a/third_party/closure-compiler/node-externs/string_decoder.js +++ b/third_party/closure-compiler/node-externs/string_decoder.js @@ -35,7 +35,7 @@ var StringDecoder = function(encoding) {}; /** - * @param {buffer.Buffer} buffer + * @param {nodeBuffer.Buffer} buffer * @return {string} */ StringDecoder.prototype.write = function(buffer) {}; @@ -46,13 +46,13 @@ StringDecoder.prototype.write = function(buffer) {}; StringDecoder.prototype.toString = function() {}; /** - * @param {buffer.Buffer} buffer + * @param {nodeBuffer.Buffer} buffer * @return {number} */ StringDecoder.prototype.detectIncompleteChar = function(buffer) {}; /** - * @param {buffer.Buffer} buffer + * @param {nodeBuffer.Buffer} buffer * @return {string} */ StringDecoder.prototype.end = function(buffer) {}; diff --git a/third_party/closure-compiler/node-externs/tls.js b/third_party/closure-compiler/node-externs/tls.js index 02a6d936df058..02a7f355e64aa 100644 --- a/third_party/closure-compiler/node-externs/tls.js +++ b/third_party/closure-compiler/node-externs/tls.js @@ -34,7 +34,7 @@ var tls = {}; /** - * @typedef {{pfx: (string|buffer.Buffer), key: (string|buffer.Buffer), passphrase: string, cert: (string|buffer.Buffer), ca: Array., crl: (string|Array.), ciphers: string, honorCipherOrder: boolean, requestCert: boolean, rejectUnauthorized: boolean, NPNProtocols: (Array|buffer.Buffer), SNICallback: function(string), sessionIdContext: string}} + * @typedef {{pfx: (string|nodeBuffer.Buffer), key: (string|nodeBuffer.Buffer), passphrase: string, cert: (string|nodeBuffer.Buffer), ca: Array., crl: (string|Array.), ciphers: string, honorCipherOrder: boolean, requestCert: boolean, rejectUnauthorized: boolean, NPNProtocols: (Array|nodeBuffer.Buffer), SNICallback: function(string), sessionIdContext: string}} */ tls.CreateOptions; @@ -47,7 +47,7 @@ tls.CreateOptions; tls.createServer = function(options, secureConnectionListener) {}; /** - * @typedef {{host: string, port: number, socket: *, pfx: (string|buffer.Buffer), key: (string|buffer.Buffer), passphrase: string, cert: (string|buffer.Buffer), ca: Array., rejectUnauthorized: boolean, NPNProtocols: Array., servername: string}} + * @typedef {{host: string, port: number, socket: *, pfx: (string|nodeBuffer.Buffer), key: (string|nodeBuffer.Buffer), passphrase: string, cert: (string|nodeBuffer.Buffer), ca: Array., rejectUnauthorized: boolean, NPNProtocols: Array., servername: string}} */ tls.ConnectOptions; @@ -83,7 +83,7 @@ tls.Server = function() {}; /** * @param {string} hostname - * @param {string|buffer.Buffer} credentials + * @param {string|nodeBuffer.Buffer} credentials */ tls.Server.prototype.addContext = function(hostname, credentials) {}; diff --git a/third_party/closure-compiler/node-externs/zlib.js b/third_party/closure-compiler/node-externs/zlib.js index 30b95b7ad7f30..00c85dfde0fc6 100644 --- a/third_party/closure-compiler/node-externs/zlib.js +++ b/third_party/closure-compiler/node-externs/zlib.js @@ -141,43 +141,43 @@ zlib.createUnzip = function(options) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.deflate = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.deflateRaw = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.gzip = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.gunzip = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.inflate = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.inflateRaw = function(buf, callback) {}; /** - * @param {string|buffer.Buffer} buf + * @param {string|nodeBuffer.Buffer} buf * @param {function(...)} callback */ zlib.unzip = function(buf, callback) {};