Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Side by Side Diff: test/cctest/test-decls.cc

Issue 893993007: Protect against uninitialized lexical variables at top-level. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/ic.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698