Sha256: 74d84be4dfa6da54358a06c84279a13933f64e4dab79de394cb6ff7605832233

Contents?: true

Size: 591 Bytes

Versions: 17

Compression:

Stored size: 591 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))

class ReturnTest < Johnson::NodeTestCase
  def test_return
    assert_sexp([[:func_expr, "foo", [], [[:return, nil]]]],
      @parser.parse('function foo() { return; }'))
    assert_ecma("function foo() {\n  return;\n}",
      @parser.parse('function foo() { return; }'))


    assert_sexp([[:func_expr, "foo", [], [[:return, [:lit, 10]]]]],
      @parser.parse('function foo() { return 10; }'))
    assert_ecma("function foo() {\n  return 10;\n}",
      @parser.parse('function foo() { return 10; }'))
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jbarnette-johnson-1.0.0.200806240111 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.200807291507 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.200808062051 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.200808062111 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.200811251942 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20081126120511 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090127202936 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090225110820 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090326122910 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090326154650 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090326161333 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090402144841 test/johnson/nodes/return_test.rb
jbarnette-johnson-1.0.0.20090402155420 test/johnson/nodes/return_test.rb
johnson-1.2.0 test/johnson/nodes/return_test.rb
johnson-1.1.1 test/johnson/nodes/return_test.rb
johnson-1.1.2 test/johnson/nodes/return_test.rb
johnson-1.1.0 test/johnson/nodes/return_test.rb