| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 with ({}) {}; | 146 with ({}) {}; |
| 147 })(); | 147 })(); |
| 148 | 148 |
| 149 // Octal literal | 149 // Octal literal |
| 150 CheckStrictMode("var x = 012"); | 150 CheckStrictMode("var x = 012"); |
| 151 CheckStrictMode("012"); | 151 CheckStrictMode("012"); |
| 152 CheckStrictMode("'Hello octal\\032'"); | 152 CheckStrictMode("'Hello octal\\032'"); |
| 153 CheckStrictMode("function octal() { return 012; }"); | 153 CheckStrictMode("function octal() { return 012; }"); |
| 154 CheckStrictMode("function octal() { return '\\032'; }"); | 154 CheckStrictMode("function octal() { return '\\032'; }"); |
| 155 | 155 |
| 156 // NonOctalDecimalIntegerLiteral |
| 157 CheckStrictMode("var x = 018"); |
| 158 CheckStrictMode("081"); |
| 159 CheckStrictMode("function octal() { return 0181; }"); |
| 160 |
| 156 (function ValidEscape() { | 161 (function ValidEscape() { |
| 157 "use strict"; | 162 "use strict"; |
| 158 var x = '\0'; | 163 var x = '\0'; |
| 159 var y = "\0"; | 164 var y = "\0"; |
| 160 })(); | 165 })(); |
| 161 | 166 |
| 162 // Octal before "use strict" | 167 // Octal before "use strict" |
| 163 assertThrows('\ | 168 assertThrows('\ |
| 164 function strict() {\ | 169 function strict() {\ |
| 165 "octal\\032directive";\ | 170 "octal\\032directive";\ |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 assertSame(null, test(i)); | 1227 assertSame(null, test(i)); |
| 1223 } | 1228 } |
| 1224 })(); | 1229 })(); |
| 1225 | 1230 |
| 1226 | 1231 |
| 1227 (function TestStrictModeEval() { | 1232 (function TestStrictModeEval() { |
| 1228 "use strict"; | 1233 "use strict"; |
| 1229 eval("var eval_local = 10;"); | 1234 eval("var eval_local = 10;"); |
| 1230 assertThrows(function() { return eval_local; }, ReferenceError); | 1235 assertThrows(function() { return eval_local; }, ReferenceError); |
| 1231 })(); | 1236 })(); |
| OLD | NEW |