summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1380962.js
blob: b05624b989aa119450aa100242abcd4d1adbe0a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
// |jit-test| skip-if: !Function.prototype.toSource

// Source string has balanced parentheses even when the source code was discarded.

function test() {
eval("var f = function() { return 0; };");
assertEq(f.toSource(), "(function() {\n    [native code]\n})");
}

var g = newGlobal({ discardSource: true });
g.evaluate(test.toString() + "test()");