| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // "use strict";\ | 108 // "use strict";\ |
| 109 //}', SyntaxError); | 109 //}', SyntaxError); |
| 110 | 110 |
| 111 // Strict mode doesn't affect the outer stop of strict code. | 111 // Strict mode doesn't affect the outer stop of strict code. |
| 112 function NotStrict(eval) { | 112 function NotStrict(eval) { |
| 113 function Strict() { | 113 function Strict() { |
| 114 "use strict"; | 114 "use strict"; |
| 115 } | 115 } |
| 116 with ({}) {}; | 116 with ({}) {}; |
| 117 } | 117 } |
| 118 |
| 119 // Octal literal |
| 120 CheckStrictMode("var x = 012"); |
| 121 CheckStrictMode("012"); |
| 122 CheckStrictMode("'Hello octal\\032'"); |
| 123 CheckStrictMode("function octal() { return 012; }"); |
| 124 CheckStrictMode("function octal() { return '\\032'; }"); |
| 125 |
| 126 // Octal before "use strict" |
| 127 assertThrows('\ |
| 128 function strict() {\ |
| 129 "octal\\032directive";\ |
| 130 "use strict";\ |
| 131 }', SyntaxError); |
| OLD | NEW |