haikuwebkit/LayoutTests/js/script-tests/function-constructor-single...

9 lines
341 B
JavaScript

description(
"This test checks that the Function constructor works correctly in the presence of single line comments."
);
shouldBeTrue("(new Function('return true//'))()");
shouldBeTrue("(new Function('return true;//'))()");
shouldBeTrue("(new Function('a', 'return a//'))(true)");
shouldBeTrue("(new Function('a', 'return a;//'))(true)");