Skip to content

Commit

Permalink
a bit cleanup for the PR; make the old function markFunctionStart(int…
Browse files Browse the repository at this point in the history
…) deprecated and do not use the old stuff internally
  • Loading branch information
rbri committed Apr 27, 2024
1 parent 709874b commit a3dfe64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/org/mozilla/javascript/Decompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ int markFunctionStart(int functionType, boolean isGenerator) {
return savedOffset;
}

/** @deprecated use {@link #markFunctionStart(int, boolean)} instead */
@Deprecated
int markFunctionStart(int functionType) {
return markFunctionStart(functionType, false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/mozilla/javascript/IRFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ private Node transformGenExpr(GeneratorExpression node) {
fn.setRequiresActivation();

int functionType = fn.getFunctionType();
int start = decompiler.markFunctionStart(functionType);
int start = decompiler.markFunctionStart(functionType, false);
Node mexpr = decompileFunctionHeader(fn);
int index = parser.currentScriptOrFn.addFunction(fn);

Expand Down
1 change: 0 additions & 1 deletion testsrc/jstests/harmony/generators-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ assertEquals(undefined, r.value);
assertTrue(r.done);

// toString returns the correct value

assertEquals("\nfunction* gen() {\n for (var i = 0; i < 3; i++) {\n yield i;\n }\n}\n", gen.toString());

"success";

0 comments on commit a3dfe64

Please sign in to comment.