mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 776314 - Stub out genexp toSource. r=luke
This commit is contained in:
parent
82a0c3817c
commit
a810a5ad27
7
js/src/jit-test/tests/basic/function-tosource-genexpr.js
Normal file
7
js/src/jit-test/tests/basic/function-tosource-genexpr.js
Normal file
@ -0,0 +1,7 @@
|
||||
function getgen() {
|
||||
gen = getgen.caller;
|
||||
}
|
||||
var gen;
|
||||
(getgen() for (x of [1])).next();
|
||||
assertEq(gen.toSource(), "function genexp() {\n [generator expression]\n}");
|
||||
assertEq(decompileBody(gen), "\n [generator expression]\n");
|
@ -577,6 +577,14 @@ JSFunction::toString(JSContext *cx, bool bodyOnly, bool lambdaParen)
|
||||
{
|
||||
StringBuffer out(cx);
|
||||
|
||||
if (isInterpreted() && script()->isGeneratorExp) {
|
||||
if ((!bodyOnly && !out.append("function genexp() {")) ||
|
||||
!out.append("\n [generator expression]\n") ||
|
||||
(!bodyOnly && !out.append("}"))) {
|
||||
return NULL;
|
||||
}
|
||||
return out.finishString();
|
||||
}
|
||||
if (!bodyOnly) {
|
||||
// If we're not in pretty mode, put parentheses around lambda functions.
|
||||
if (isInterpreted() && !lambdaParen && (flags & JSFUN_LAMBDA)) {
|
||||
|
Loading…
Reference in New Issue
Block a user