class RubyRunJs::OPCODES::NEW
Public Instance Methods
eval(ctx)
click to toggle source
# File lib/ruby_run_js/opcodes.rb, line 715 def eval(ctx) args = ctx.stack.pop() constructor = ctx.stack.pop() if is_primitive(constructor) || !constructor.methods.include?(:construct) raise make_error('TypeError', "#{constructor.js_class} is not a constructor") end ctx.stack.append(constructor.construct(args)) nil end