Repository: flex-falcon Updated Branches: refs/heads/develop f0ebbf0ca -> 65f73df30
try to fix array externs Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/65f73df3 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/65f73df3 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/65f73df3 Branch: refs/heads/develop Commit: 65f73df30ba9cb03a42d22bf58d472720a667800 Parents: f0ebbf0 Author: Alex Harui <[email protected]> Authored: Thu Nov 26 10:48:03 2015 -0800 Committer: Alex Harui <[email protected]> Committed: Thu Nov 26 10:48:03 2015 -0800 ---------------------------------------------------------------------- externs/js/missing.js | 92 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/65f73df3/externs/js/missing.js ---------------------------------------------------------------------- diff --git a/externs/js/missing.js b/externs/js/missing.js index 274a6f5..d602419 100644 --- a/externs/js/missing.js +++ b/externs/js/missing.js @@ -137,4 +137,94 @@ function Location() {} /** * @type {number} */ -XMLHttpRequest.prototype.timeout; \ No newline at end of file +XMLHttpRequest.prototype.timeout; + + +/***** hack ****/ +/* below are copies from es3.js, which is: + Copyright 2008 The Closure Compiler Authors + + es3.js includes Mozilla-only static versions + of these methods which confuses the externs compiler. The externs compiler + currently doesn't expect a class to have a static and instance method of the + same name. Last definition found wins so by re-declaring here the instance + methods win out */ +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @this {{length: number}|Array.<T>|string} + * @nosideeffects + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/indexOf + */ +Array.prototype.indexOf = function(obj, opt_fromIndex) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {T} obj + * @param {number=} opt_fromIndex + * @return {number} + * @this {{length: number}|Array.<T>|string} + * @nosideeffects + * @template T + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/lastIndexOf + */ +Array.prototype.lastIndexOf = function(obj, opt_fromIndex) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.<T>): ?} callback + * @param {S=} opt_thisobj + * @return {boolean} + * @this {{length: number}|Array.<T>|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/every + */ +Array.prototype.every = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.<T>): ?} callback + * @param {S=} opt_thisobj + * @return {!Array.<T>} + * @this {{length: number}|Array.<T>|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter + */ +Array.prototype.filter = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.<T>): ?} callback + * @param {S=} opt_thisobj + * @this {{length: number}|Array.<T>|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/forEach + */ +Array.prototype.forEach = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.<T>): R} callback + * @param {S=} opt_thisobj + * @return {!Array.<R>} + * @this {{length: number}|Array.<T>|string} + * @template T,S,R + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/map + */ +Array.prototype.map = function(callback, opt_thisobj) {}; + +/** + * Available in ECMAScript 5, Mozilla 1.6+. + * @param {?function(this:S, T, number, !Array.<T>): ?} callback + * @param {S=} opt_thisobj + * @return {boolean} + * @this {{length: number}|Array.<T>|string} + * @template T,S + * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/some + */ +Array.prototype.some = function(callback, opt_thisobj) {}; + +/**** end hack **/ \ No newline at end of file
