| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "test/cctest/compiler/function-tester.h" | 5 #include "test/cctest/compiler/function-tester.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 TEST(GlobalLoad) { | 388 TEST(GlobalLoad) { |
| 389 FunctionTester T("(function() { return g; })"); | 389 FunctionTester T("(function() { return g; })"); |
| 390 | 390 |
| 391 T.CheckThrows(T.undefined(), T.undefined()); | 391 T.CheckThrows(T.undefined(), T.undefined()); |
| 392 CompileRun("var g = 23;"); | 392 CompileRun("var g = 23;"); |
| 393 T.CheckCall(T.Val(23)); | 393 T.CheckCall(T.Val(23)); |
| 394 } | 394 } |
| 395 | 395 |
| 396 | 396 |
| 397 TEST(GlobalStoreSloppy) { | 397 TEST(GlobalStoreSloppy) { |
| 398 FLAG_legacy_const = true; |
| 398 FunctionTester T("(function(a,b) { g = a + b; return g; })"); | 399 FunctionTester T("(function(a,b) { g = a + b; return g; })"); |
| 399 | 400 |
| 400 T.CheckCall(T.Val(33), T.Val(22), T.Val(11)); | 401 T.CheckCall(T.Val(33), T.Val(22), T.Val(11)); |
| 401 CompileRun("delete g"); | 402 CompileRun("delete g"); |
| 402 CompileRun("const g = 23"); | 403 CompileRun("const g = 23"); |
| 403 T.CheckCall(T.Val(23), T.Val(55), T.Val(44)); | 404 T.CheckCall(T.Val(23), T.Val(55), T.Val(44)); |
| 404 } | 405 } |
| 405 | 406 |
| 406 | 407 |
| 407 TEST(GlobalStoreStrict) { | 408 TEST(GlobalStoreStrict) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 "})"; | 536 "})"; |
| 536 FunctionTester T(src); | 537 FunctionTester T(src); |
| 537 | 538 |
| 538 T.CheckCall(T.Val(65), T.Val(23), T.Val(42)); | 539 T.CheckCall(T.Val(65), T.Val(23), T.Val(42)); |
| 539 T.CheckCall(T.Val("ab"), T.Val("a"), T.Val("b")); | 540 T.CheckCall(T.Val("ab"), T.Val("a"), T.Val("b")); |
| 540 } | 541 } |
| 541 | 542 |
| 542 } // namespace compiler | 543 } // namespace compiler |
| 543 } // namespace internal | 544 } // namespace internal |
| 544 } // namespace v8 | 545 } // namespace v8 |
| OLD | NEW |