Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (13 sloc) 0.531 kb
require "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
Jump to Line
Something went wrong with that request. Please try again.