LEFT | RIGHT |
(no file at all) | |
1 // Copyright (C) 2007 Google Inc. | 1 // Copyright (C) 2007 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 //////////////////////////////////////////////////////////////////////// | 778 //////////////////////////////////////////////////////////////////////// |
779 | 779 |
780 public final void testWith() throws Exception { | 780 public final void testWith() throws Exception { |
781 checkFails("with (dreams || ambiguousScoping) anything.isPossible();", | 781 checkFails("with (dreams || ambiguousScoping) anything.isPossible();", |
782 "\"with\" blocks are not allowed"); | 782 "\"with\" blocks are not allowed"); |
783 checkFails("with (dreams || ambiguousScoping) { anything.isPossible(); }", | 783 checkFails("with (dreams || ambiguousScoping) { anything.isPossible(); }", |
784 "\"with\" blocks are not allowed"); | 784 "\"with\" blocks are not allowed"); |
785 } | 785 } |
786 | 786 |
787 public final void testSESCompatibilityWarnings() throws Exception { | 787 public final void testSESCompatibilityWarnings() throws Exception { |
788 checkAddsMessage(js(fromString( | |
789 "var xxx = (1 + 2) /3;")), | |
790 RewriterMessageType.TOP_LEVEL_VAR_INCOMPATIBLE_WITH_CAJA); | |
791 checkAddsMessage(js(fromString( | |
792 "var xxx;")), | |
793 RewriterMessageType.TOP_LEVEL_VAR_INCOMPATIBLE_WITH_CAJA); | |
794 checkAddsMessage(js(fromString( | 788 checkAddsMessage(js(fromString( |
795 "function yyy() {};")), | 789 "function yyy() {};")), |
796 RewriterMessageType.TOP_LEVEL_FUNC_INCOMPATIBLE_WITH_CAJA); | 790 RewriterMessageType.TOP_LEVEL_FUNC_INCOMPATIBLE_WITH_CAJA); |
797 } | 791 } |
798 | 792 |
799 public final void testTryCatch() throws Exception { | 793 public final void testTryCatch() throws Exception { |
800 checkAddsMessage(js(fromString( | 794 checkAddsMessage(js(fromString( |
801 "try {" + | 795 "try {" + |
802 " throw 2;" + | 796 " throw 2;" + |
803 "} catch (e) {" + | 797 "} catch (e) {" + |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 new Executor.Input(cajoledJs, getName() + "-cajoled"), | 1972 new Executor.Input(cajoledJs, getName() + "-cajoled"), |
1979 new Executor.Input(post, getName()), | 1973 new Executor.Input(post, getName()), |
1980 // Return the output field as the value of the run. | 1974 // Return the output field as the value of the run. |
1981 new Executor.Input( | 1975 new Executor.Input( |
1982 "___.getNewModuleHandler().getLastValue();", getName())); | 1976 "___.getNewModuleHandler().getLastValue();", getName())); |
1983 | 1977 |
1984 assertNoErrors(); | 1978 assertNoErrors(); |
1985 return result; | 1979 return result; |
1986 } | 1980 } |
1987 } | 1981 } |
LEFT | RIGHT |