Invalid flags in a RegExp literal should be an early SyntaxError
[WebKit-https.git] / JSTests / stress / global-const-redeclaration-setting-5.js
1 var setGlobalConstRedeclarationShouldNotThrow = $vm.setGlobalConstRedeclarationShouldNotThrow;
2
3 function assert(b) {
4     if (!b)
5         throw new Error("Bad assertion.");
6 }
7
8 setGlobalConstRedeclarationShouldNotThrow(); // Allow duplicate const declarations at the global level.
9
10 load("./global-const-redeclaration-setting/let.js");
11 assert(foo === 50);
12 let threw = false;
13 try {
14     load("./global-const-redeclaration-setting/first.js"); // Redeclaration of a 'let' to 'const' should always throw because it isn't breaking backwards compat.
15 } catch(e) {
16     threw = true;
17 }
18
19 assert(threw);
20 assert(foo === 50);