| Index: test/mjsunit/regress/regress-2470.js
|
| diff --git a/test/mjsunit/parallel-optimize-disabled.js b/test/mjsunit/regress/regress-2470.js
|
| similarity index 70%
|
| copy from test/mjsunit/parallel-optimize-disabled.js
|
| copy to test/mjsunit/regress/regress-2470.js
|
| index 2487964bd99a5497c9166c52fe8de4862ac55ba9..eed381699d66de7f90f6a8ad2ff3ff59213134ab 100644
|
| --- a/test/mjsunit/parallel-optimize-disabled.js
|
| +++ b/test/mjsunit/regress/regress-2470.js
|
| @@ -25,22 +25,18 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Flags: --nodead-code-elimination --parallel-recompilation
|
| -// Flags: --allow-natives-syntax
|
| +// Test whether the opening parenthesis can be eaten up by a comment.
|
| +assertThrows('Function("/*", "*/){");', SyntaxError);
|
|
|
| -function g() { // g() cannot be optimized.
|
| - const x = 1;
|
| - x++;
|
| -}
|
| +// Test whether the function literal can be closed prematurely.
|
| +assertThrows('Function("});(function(){");', SyntaxError);
|
|
|
| -function f(x) {
|
| - g();
|
| -}
|
| -
|
| -f();
|
| -f();
|
| -%OptimizeFunctionOnNextCall(g, "parallel");
|
| -%OptimizeFunctionOnNextCall(f);
|
| -f(0); // g() is disabled for optimization on inlining attempt.
|
| -g(); // Attempt to optimize g() should not run into any assertion.
|
| +// Test whether block comments are handled correctly.
|
| +assertDoesNotThrow('Function("/*", "*/", "/**/");');
|
| +assertDoesNotThrow('Function("/*", "a", "*/", "/**/");');
|
| +assertThrows('Function("a", "/*", "*/", "/**/");', SyntaxError);
|
|
|
| +// Test whether line comments are handled correctly.
|
| +assertDoesNotThrow('Function("//", "//")');
|
| +assertDoesNotThrow('Function("//", "//", "//")');
|
| +assertThrows('Function("a", "//", "//")', SyntaxError);
|
|
|