Chromium Code Reviews| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 function h1() { } | 142 function h1() { } |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 { | 145 { |
| 146 function g1() { } | 146 function g1() { } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 f(); | 149 f(); |
| 150 | 150 |
| 151 // Test function declarations in statement position in strict mode. | 151 // Test function declarations in statement position in strict mode. |
| 152 TestLocalThrows("function f() { if (true) function g() {}", SyntaxError); | 152 TestLocalThrows("function f() { if (true) function g() {} }", SyntaxError); |
|
arv (Not doing code reviews)
2015/03/03 16:17:31
It would be nice if these were changed into test/m
Dmitry Lomov (no reviews)
2015/03/03 16:36:18
That would be awesome but unfortunately not practi
| |
| 153 TestLocalThrows("function f() { if (true) {} else function g() {}", SyntaxError) ; | 153 TestLocalThrows("function f() { if (true) {} else function g() {} }", SyntaxErro r); |
| 154 TestLocalThrows("function f() { do function g() {} while (false)", SyntaxError); | 154 TestLocalThrows("function f() { do function g() {} while (false) }", SyntaxError ); |
| 155 TestLocalThrows("function f() { while (false) function g() {}", SyntaxError); | 155 TestLocalThrows("function f() { while (false) function g() {} }", SyntaxError); |
| 156 TestLocalThrows("function f() { label: function g() {}", SyntaxError); | 156 TestLocalThrows("function f() { label: function g() {} }", SyntaxError); |
|
rossberg
2015/03/04 10:42:14
Oh wait. Actually this one shouldn't be a syntax e
Dmitry Lomov (no reviews)
2015/03/13 14:33:20
We can make it a syntax error since we are free to
| |
| 157 TestLocalThrows("function f() { for (;false;) function g() {}", SyntaxError); | 157 TestLocalThrows("function f() { for (;false;) function g() {} }", SyntaxError); |
| 158 TestLocalThrows("function f() { switch (true) { case true: function g() {} }", S yntaxError); | 158 TestLocalThrows("function f() { switch (true) { case true: function g() {} } }", SyntaxError); |
|
rossberg
2015/03/04 10:42:14
Neither the last two.
| |
| 159 TestLocalThrows("function f() { switch (true) { default: function g() {} }", Syn taxError); | 159 TestLocalThrows("function f() { switch (true) { default: function g() {} } }", S yntaxError); |
| OLD | NEW |