decaffeinate-parser
Advanced tools
Comparing version
@@ -139,2 +139,16 @@ 'use strict'; | ||
value = accessOpForProperty(value, prop, node.base.locationData); | ||
if (value.type === 'MemberAccessOp' && value.expression.type === 'MemberAccessOp') { | ||
if (value.expression.memberName === 'prototype' && value.expression.raw.slice(-2) === '::') { | ||
// Un-expand shorthand prototype access. | ||
value = { | ||
type: 'ProtoMemberAccessOp', | ||
line: value.line, | ||
column: value.column, | ||
range: value.range, | ||
raw: value.raw, | ||
expression: value.expression.expression, | ||
memberName: value.memberName | ||
}; | ||
} | ||
} | ||
}); | ||
@@ -141,0 +155,0 @@ return value; |
{ | ||
"name": "decaffeinate-parser", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A better AST for CoffeeScript, inspired by CoffeeScriptRedux.", | ||
@@ -30,3 +30,6 @@ "main": "lib/parser.js", | ||
"string-repeat": "^1.1.1" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
} | ||
} |
@@ -94,2 +94,16 @@ import isChainedComparison from './util/isChainedComparison'; | ||
value = accessOpForProperty(value, prop, node.base.locationData); | ||
if (value.type === 'MemberAccessOp' && value.expression.type === 'MemberAccessOp') { | ||
if (value.expression.memberName === 'prototype' && value.expression.raw.slice(-2) === '::') { | ||
// Un-expand shorthand prototype access. | ||
value = { | ||
type: 'ProtoMemberAccessOp', | ||
line: value.line, | ||
column: value.column, | ||
range: value.range, | ||
raw: value.raw, | ||
expression: value.expression.expression, | ||
memberName: value.memberName | ||
}; | ||
} | ||
} | ||
}); | ||
@@ -96,0 +110,0 @@ return value; |
61880
2.04%1739
1.64%