| 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 13 matching lines...) Expand all Loading... |
| 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 # In strict mode, function declarations may only appear as source elements. | 28 # In strict mode, function declarations may only appear as source elements. |
| 29 | 29 |
| 30 # A template that performs the same strict-mode test in different | 30 # A template that performs the same strict-mode test in different |
| 31 # scopes (global scope, function scope, and nested function scope). | 31 # scopes (global scope, function scope, and nested function scope). |
| 32 def StrictTest(name, source, legacy): | 32 def StrictTest(name, source, legacy): |
| 33 if legacy: | 33 if legacy: |
| 34 extra_flags = ["--noharmony-scoping"] | 34 extra_flags = [ |
| 35 "--noharmony-scoping", |
| 36 "--noharmony-classes", |
| 37 "--noharmony-object-literals"] |
| 35 else: | 38 else: |
| 36 extra_flags = [] | 39 extra_flags = [] |
| 37 Test(name, '"use strict";\n' + source, "strict_function", | 40 Test(name, '"use strict";\n' + source, "strict_function", |
| 38 extra_flags) | 41 extra_flags) |
| 39 Test(name + '-infunc', | 42 Test(name + '-infunc', |
| 40 'function foo() {\n "use strict";\n' + source +'\n}\n', | 43 'function foo() {\n "use strict";\n' + source +'\n}\n', |
| 41 "strict_function", | 44 "strict_function", |
| 42 extra_flags) | 45 extra_flags) |
| 43 Test(name + '-infunc2', | 46 Test(name + '-infunc2', |
| 44 'function foo() {\n "use strict";\n function bar() {\n' + | 47 'function foo() {\n "use strict";\n function bar() {\n' + |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 StrictTest("switch-case", """ | 100 StrictTest("switch-case", """ |
| 98 switch (true) { case true: function foo() { } } | 101 switch (true) { case true: function foo() { } } |
| 99 """, False) | 102 """, False) |
| 100 | 103 |
| 101 StrictTest("labeled", """ | 104 StrictTest("labeled", """ |
| 102 label: function foo() { } | 105 label: function foo() { } |
| 103 """, False) | 106 """, False) |
| 104 | 107 |
| 105 | 108 |
| 106 | 109 |
| OLD | NEW |