Skip to content

Instantly share code, notes, and snippets.

@geraldalewis
geraldalewis / CoffeeScript 1216 and 1348.md
Created May 11, 2011 13:21
Production notes for issue #1216 and pull #1348

#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;

@geraldalewis
geraldalewis / 1216 ?= compilation.md
Created May 10, 2011 23:42
CoffeeScript issue #1216 ?= compilation Notes

##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:

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'
@geraldalewis
geraldalewis / add_and_remove_header.coffee
Created January 2, 2011 12:47
code to add and remove HTTP request header; removed from RequestParams.
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