first draft at ticket #437 ... automatic quoting of reserved words and keywords.

This commit is contained in:
Jeremy Ashkenas
2010-06-15 00:54:02 -04:00
parent d0948e5586
commit 4b284f6687
6 changed files with 72 additions and 25 deletions

View File

@@ -474,13 +474,14 @@ exports.AccessorNode: class AccessorNode extends BaseNode
constructor: (name, tag) ->
@name: name
@prototype: tag is 'prototype'
@prototype: if tag is 'prototype' then '.prototype' else ''
@soakNode: tag is 'soak'
compileNode: (o) ->
name: @name.compile o
o.chainRoot.wrapped: or @soakNode
protoPart: if @prototype then 'prototype.' else ''
".$protoPart${@name.compile(o)}"
namePart: if name.match(IS_STRING) then "[$name]" else ".$name"
@prototype + namePart
#### IndexNode