| Index: test/mjsunit/regress/regress-1412.js
|
| diff --git a/test/mjsunit/bugs/bug-1412.js b/test/mjsunit/regress/regress-1412.js
|
| similarity index 66%
|
| rename from test/mjsunit/bugs/bug-1412.js
|
| rename to test/mjsunit/regress/regress-1412.js
|
| index 8e700d5f6cc1d5125be8aa12a6b4c005d36a5ff8..b043f1900fccdbdaef22838ae8d680bb6374a824 100644
|
| --- a/test/mjsunit/bugs/bug-1412.js
|
| +++ b/test/mjsunit/regress/regress-1412.js
|
| @@ -25,10 +25,35 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -function f() { "use strict"; print(this); }
|
| +// Test that the apply with arguments optimization passes values
|
| +// unchanged to strict-mode functions and builtins.
|
|
|
| -function g() { assertEquals(void 0, f.apply(undefined, arguments)); }
|
| +// Flags: --allow-natives-syntax
|
|
|
| -for (var i = 0; i < 10; i++) g();
|
| -%OptimizeFunctionOnNextCall(g);
|
| -g();
|
| +function strict() { "use strict"; return this; }
|
| +
|
| +function test_strict() {
|
| + assertEquals(void 0, strict.apply(undefined, arguments));
|
| + assertEquals(42, strict.apply(42, arguments));
|
| + assertEquals("asdf", strict.apply("asdf", arguments));
|
| +}
|
| +
|
| +for (var i = 0; i < 10; i++) test_strict();
|
| +%OptimizeFunctionOnNextCall(test_strict);
|
| +test_strict();
|
| +
|
| +function test_builtin(receiver) {
|
| + Object.prototype.valueOf.apply(receiver, arguments);
|
| +}
|
| +
|
| +for (var i = 0; i < 10; i++) test_builtin(this);
|
| +%OptimizeFunctionOnNextCall(test_builtin);
|
| +test_builtin(this);
|
| +
|
| +var exception = false;
|
| +try {
|
| + test_builtin(undefined);
|
| +} catch(e) {
|
| + exception = true;
|
| +}
|
| +assertTrue(exception);
|
|
|