module JavaScript::Syntax
Private Instance Methods
`(string)
click to toggle source
# File lib/javascript.rb, line 142 def `(string) __caller__.eval(string.inspect.gsub(/\$(?={)/, '#')) end
function(*args, &block)
click to toggle source
# File lib/javascript.rb, line 150 def function(*args, &block) if args.length == 1 && Function === args[0] hash = @parent ? @locals : global.__hash__ hash[args[0].name] = args[0] else Function.new(nil, args, block) end end
global()
click to toggle source
# File lib/javascript.rb, line 124 def global @global end
let(*identifiers)
click to toggle source
# File lib/javascript.rb, line 136 def let(*identifiers) end
new(identifier)
click to toggle source
# File lib/javascript.rb, line 146 def new(identifier) ::Object.const_get(identifier.name).new(*identifier.args) end
this()
click to toggle source
# File lib/javascript.rb, line 128 def this @target end
undefined()
click to toggle source
# File lib/javascript.rb, line 132 def undefined nil end
var(*identifiers)
click to toggle source
# File lib/javascript.rb, line 139 def var(*identifiers) end
window()
click to toggle source
# File lib/javascript.rb, line 120 def window @global end