Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

coffee#1771: corrected __indexOf fallback again

  • Loading branch information...
commit 0987588816c88799db5c10fed7edfa824b8545dd 1 parent 3fe3678
@satyr authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 lib/ast.js
  2. +2 −2 lib/lexer.js
  3. +2 −2 src/ast.co
View
6 lib/ast.js
@@ -1,6 +1,6 @@
var Node, Negatable, Block, Atom, Literal, Var, Key, Index, Chain, Call, List, Obj, Prop, Arr, Unary, Binary, Assign, Import, Of, Existence, Fun, Class, Super, Parens, Splat, Jump, Throw, Return, While, For, Try, Switch, Case, If, Label, JS, Util, UTILITIES, LEVEL_TOP, LEVEL_PAREN, LEVEL_LIST, LEVEL_COND, LEVEL_OP, LEVEL_CALL, PREC, TAB, ID, SIMPLENUM, _ref, __slice = [].slice, __indexOf = [].indexOf || function(x){
- var i = -1, l = this.length;
- while (++i < l) if (this.hasOwnProperty(i) && this[i] === x) return i;
+ var i = -1, l = this.length >>> 0;
+ while (++i < l) if (i in this && this[i] === x) return i;
return -1;
};
(Node = function(){
@@ -3155,7 +3155,7 @@ UTILITIES = {
toString: '{}.toString',
join: '[].join',
slice: '[].slice',
- indexOf: '[].indexOf || function(x){\n var i = -1, l = this.length;\n while (++i < l) if (this.hasOwnProperty(i) && this[i] === x) return i;\n return -1;\n}'
+ indexOf: '[].indexOf || function(x){\n var i = -1, l = this.length >>> 0;\n while (++i < l) if (i in this && this[i] === x) return i;\n return -1;\n}'
};
LEVEL_TOP = 0;
LEVEL_PAREN = 1;
View
4 lib/lexer.js
@@ -1,6 +1,6 @@
var string, TABS, unlines, enlines, enslash, reslash, character, KEYWORDS_SHARED, KEYWORDS_UNUSED, KEYWORDS, ID, SYMBOL, SPACE, MULTIDENT, SIMPLESTR, JSTOKEN, BSTOKEN, NUMBER, NUMBER_OMIT, REGEX, HEREGEX_OMIT, LASTDENT, OPENERS, CLOSERS, INVERSES, CHAIN, ARG, __indexOf = [].indexOf || function(x){
- var i = -1, l = this.length;
- while (++i < l) if (this.hasOwnProperty(i) && this[i] === x) return i;
+ var i = -1, l = this.length >>> 0;
+ while (++i < l) if (i in this && this[i] === x) return i;
return -1;
}, __slice = [].slice;
exports.lex = function(code, options){
View
4 src/ast.co
@@ -1978,8 +1978,8 @@ UTILITIES =
join : '[].join'
slice : '[].slice'
indexOf : '''[].indexOf || function(x){
- var i = -1, l = this.length;
- while (++i < l) if (this.hasOwnProperty(i) && this[i] === x) return i;
+ var i = -1, l = this.length >>> 0;
+ while (++i < l) if (i in this && this[i] === x) return i;
return -1;
}'''
Please sign in to comment.
Something went wrong with that request. Please try again.