Index: test/mjsunit/regress/regress-osr-in-literal.js |
diff --git a/test/mjsunit/regress/regress-osr-in-literal.js b/test/mjsunit/regress/regress-osr-in-literal.js |
index 9d0897276ea675467e7de28a34b8154a88aeced5..bef107ef1c5ef5ea64dceff2d318423c4056bbf9 100644 |
--- a/test/mjsunit/regress/regress-osr-in-literal.js |
+++ b/test/mjsunit/regress/regress-osr-in-literal.js |
@@ -4,6 +4,8 @@ |
// Flags: --allow-natives-syntax --harmony-do-expressions |
+"use strict"; |
+ |
var p = {}; |
var testCases = [ |
{ s:"[1, do { _OSR_ 2 }, 3]", r:[1, 2, 3] }, |
@@ -14,11 +16,13 @@ var testCases = [ |
{ s:"{ [do { _OSR_ 'b' }]: 3 }", r:{ b:3 } }, |
{ s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }", r:{ b:3, c:4 } }, |
{ s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }", r:{ b:3, __proto__:p } }, |
+ { s:"class { [do { _OSR_ 'f' }]() {} }" }, |
+ { s:"class { [do { _OSR_ 'f' }]() {}; g() {} }" }, |
]; |
for (var i = 0; i < testCases.length; ++i) { |
var source = "(function f" + i + "(x) { return " + testCases[i].s + "})"; |
var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }"; |
- var fun = eval(source.replace("_OSR_", osr)); |
- assertEquals(testCases[i].r, fun(23)); |
+ var result = eval(source.replace("_OSR_", osr))(); |
+ if (testCases[i].r) assertEquals(testCases[i].r, result); |
} |