| Index: test/mjsunit/regress/regress-2407.js
|
| diff --git a/test/mjsunit/regress/regress-crbug-135066.js b/test/mjsunit/regress/regress-2407.js
|
| similarity index 77%
|
| copy from test/mjsunit/regress/regress-crbug-135066.js
|
| copy to test/mjsunit/regress/regress-2407.js
|
| index 1aeca8b1a32d678ba7274c60230a77fdda97f6aa..eba5ee0f1d84cd5af06e473789731e5b80c40fa7 100644
|
| --- a/test/mjsunit/regress/regress-crbug-135066.js
|
| +++ b/test/mjsunit/regress/regress-2407.js
|
| @@ -25,29 +25,25 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Filler long enough to trigger lazy parsing.
|
| -var filler = "//" + new Array(1024).join('x');
|
| +// Regression test for http://code.google.com/p/v8/issues/detail?id=2407.
|
| +//
|
| +// Test that Object.{seal,isSealed,freeze,isFrozen} don't throw when called
|
| +// on non-strict Function objects with a strict "caller" property.
|
|
|
| -// Test strict eval in global context.
|
| -eval(
|
| - "'use strict';" +
|
| - "var x = 23;" +
|
| - "var f = function bozo1() {" +
|
| - " return x;" +
|
| - "};" +
|
| - "assertSame(23, f());" +
|
| - filler
|
| -);
|
| +function nonStrict(fun) {
|
| + fun(nonStrict);
|
| +}
|
|
|
| -// Test default eval in strict context.
|
| -(function() {
|
| +function strict(fun) {
|
| "use strict";
|
| - eval(
|
| - "var y = 42;" +
|
| - "var g = function bozo2() {" +
|
| - " return y;" +
|
| - "};" +
|
| - "assertSame(42, g());" +
|
| - filler
|
| - );
|
| -})();
|
| + nonStrict(fun);
|
| +}
|
| +
|
| +var problematicFunctions = [
|
| + Object.isSealed,
|
| + Object.isFrozen,
|
| + Object.seal,
|
| + Object.freeze,
|
| +];
|
| +
|
| +assertDoesNotThrow(problematicFunctions.forEach(strict));
|
|
|