Merge branch 'master' of github.com:jashkenas/coffee-script
This commit is contained in:
commit
9c76c3ef8e
|
@ -1594,7 +1594,7 @@
|
|||
Existence.prototype.invert = NEGATE;
|
||||
Existence.prototype.compileNode = function(o) {
|
||||
var code, sym;
|
||||
code = this.expression.compile(o);
|
||||
code = this.expression.compile(o, LEVEL_OP);
|
||||
code = IDENTIFIER.test(code) && !o.scope.check(code) ? this.negated ? "typeof " + code + " == \"undefined\" || " + code + " === null" : "typeof " + code + " != \"undefined\" && " + code + " !== null" : (sym = this.negated ? '==' : '!=', "" + code + " " + sym + " null");
|
||||
if (o.level <= LEVEL_COND) {
|
||||
return code;
|
||||
|
|
|
@ -1216,7 +1216,7 @@ exports.Existence = class Existence extends Base
|
|||
constructor: (@expression) ->
|
||||
|
||||
compileNode: (o) ->
|
||||
code = @expression.compile o
|
||||
code = @expression.compile o, LEVEL_OP
|
||||
code = if IDENTIFIER.test(code) and not o.scope.check code
|
||||
if @negated
|
||||
"typeof #{code} == \"undefined\" || #{code} === null"
|
||||
|
|
|
@ -160,3 +160,6 @@ eq 1, a?.b.c + 1
|
|||
eq 1, a?.b.c += 1
|
||||
eq 2, ++a?.b.c
|
||||
eq yes, delete a?.b.c
|
||||
|
||||
|
||||
eq (1 or 0)?, true, 'postfix `?` should unwrap correctly'
|
||||
|
|
Loading…
Reference in New Issue