OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 context.Check("'use strict';const x = 1; x", EXPECT_RESULT, | 1138 context.Check("'use strict';const x = 1; x", EXPECT_RESULT, |
1139 Number::New(CcTest::isolate(), 1)); | 1139 Number::New(CcTest::isolate(), 1)); |
1140 context.Check("f();", EXPECT_EXCEPTION); | 1140 context.Check("f();", EXPECT_EXCEPTION); |
1141 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); | 1141 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); |
1142 context.Check("f();", EXPECT_EXCEPTION); | 1142 context.Check("f();", EXPECT_EXCEPTION); |
1143 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); | 1143 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); |
1144 context.Check("%OptimizeFunctionOnNextCall(f);f();", EXPECT_EXCEPTION); | 1144 context.Check("%OptimizeFunctionOnNextCall(f);f();", EXPECT_EXCEPTION); |
1145 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); | 1145 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); |
1146 } | 1146 } |
1147 } | 1147 } |
| 1148 |
| 1149 |
| 1150 TEST(Regress425510) { |
| 1151 i::FLAG_harmony_scoping = true; |
| 1152 i::FLAG_allow_natives_syntax = true; |
| 1153 |
| 1154 HandleScope handle_scope(CcTest::isolate()); |
| 1155 |
| 1156 { |
| 1157 SimpleContext context; |
| 1158 |
| 1159 context.Check("'use strict'; o; const o = 10", EXPECT_EXCEPTION); |
| 1160 |
| 1161 for (int i = 0; i < 100; i++) { |
| 1162 context.Check("o.prototype", EXPECT_EXCEPTION); |
| 1163 } |
| 1164 } |
| 1165 } |
OLD | NEW |