##Notes##
Update The Existential Operator
in docs
###Ticket Bug###
There's a bug in the ticket -- if(a != null) a = b;
should be if(a == null) a = b;
Of the two options:
HTTPHeader addHeader: ( HTTPHeader header ) -> | |
_headers ||= {} | |
#supports multiple headers of the same name | |
if headers[ header.name ] then header.value = headers[ header.name ].value + ";" + header.value | |
headers[ header.name ] = header | |
header | |
#! make it so that if the user uses a header object with multiple values (";"), it acts accordingly |
else if prev and not prev.spaced | |
if value is '(' and prev[0] in CALLABLE | |
prev[0] = 'FUNC_EXIST' if prev[0] is '?' | |
tag = 'CALL_START' | |
else if value is '[' and prev[0] in INDEXABLE | |
tag = 'INDEX_START' | |
switch prev[0] | |
when '?' then prev[0] = 'INDEX_SOAK' # <---- #971 | |
when '::' then prev[0] = 'INDEX_PROTO' |
##Notes##
Update The Existential Operator
in docs
###Ticket Bug###
There's a bug in the ticket -- if(a != null) a = b;
should be if(a == null) a = b;
Of the two options:
#Issue #1216 with pull
#1348#
##Issue##
As @satyr pointed out, the #1216 patch (pull #1348) broke some ?=
:
a = 1; console.log a ?= 2
would output
var a;
Adds a --debug option for .coffee scripts that outputs more helpful error messages (mapping compiled .js lines of code to the input .coffee file's lines).
This branch should be considered experimental at the moment -- it serves as a proof-of-concept and to expose additional issues with adding debugging support to CoffeeScript
Current output:
TypeError: string is not a function
@geraldalewis hello. |
adsf' | |
asdf |
diff --git a/src/nodes.coffee b/src/nodes.coffee | |
index 1697c44..cc382d7 100644 | |
--- a/src/nodes.coffee | |
+++ b/src/nodes.coffee | |
@@ -1076,19 +1076,23 @@ exports.Code = class Code extends Base | |
o.scope = new Scope o.scope, @body, this | |
o.scope.shared = del o, 'sharedScope' | |
o.indent += TAB | |
- o.uniqs = {} | |
delete o.bare |
diff --git a/src/grammar.coffee b/src/grammar.coffee | |
index e57ab39..035e168 100644 | |
--- a/src/grammar.coffee | |
+++ b/src/grammar.coffee | |
@@ -217,7 +217,7 @@ grammar = | |
# Variables and properties that can be assigned to. | |
SimpleAssignable: [ | |
o 'Identifier', -> new Value $1 | |
- o 'Value Accessor', -> $1.push $2 | |
+ o 'Value Accessor', -> $1.add $2 |
# non-default params = true arity; | |
# args <= arity: apply args to non-defaults first, in order | |
# args > arity: apply args in order | |
f = (a=0,b,c=2) -> | |
f() # a = 0 b = undefined c = 2 | |
f(1) # a = 0 b = 1 c = 2 | |
f(1,2) # a = 1 b = 2 c = 2 |