Index: test/webkit/object-literal-syntax.js |
diff --git a/test/webkit/resources/standalone-post.js b/test/webkit/object-literal-syntax.js |
similarity index 57% |
copy from test/webkit/resources/standalone-post.js |
copy to test/webkit/object-literal-syntax.js |
index d157e78bfa084329e2ec1a9b7d6ad456e904c152..6884bec40289ee038da97ce6ff3176c21de1faea 100644 |
--- a/test/webkit/resources/standalone-post.js |
+++ b/test/webkit/object-literal-syntax.js |
@@ -21,6 +21,25 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-wasPostTestScriptParsed = true; |
+description("Make sure that we correctly identify parse errors in object literals"); |
-finishJSTest(); |
+shouldThrow("({a:1, get a(){}})"); |
+shouldThrow("({a:1, set a(){}})"); |
+shouldThrow("({get a(){}, a:1})"); |
+shouldThrow("({set a(){}, a:1})"); |
+shouldThrow("({get a(){}, get a(){}})"); |
+shouldThrow("({set a(){}, set a(){}})"); |
+shouldThrow("({set a(){}, get a(){}, set a(){}})"); |
+shouldThrow("(function(){({a:1, get a(){}})})"); |
+shouldThrow("(function(){({a:1, set a(){}})})"); |
+shouldThrow("(function(){({get a(){}, a:1})})"); |
+shouldThrow("(function(){({set a(){}, a:1})})"); |
+shouldThrow("(function(){({get a(){}, get a(){}})})"); |
+shouldThrow("(function(){({set a(){}, set a(){}})})"); |
+shouldThrow("(function(){({set a(){}, get a(){}, set a(){}})})"); |
+shouldBeTrue("({a:1, a:1, a:1}), true"); |
+shouldBeTrue("({get a(){}, set a(){}}), true"); |
+shouldBeTrue("({set a(){}, get a(){}}), true"); |
+shouldBeTrue("(function(){({a:1, a:1, a:1})}), true"); |
+shouldBeTrue("(function(){({get a(){}, set a(){}})}), true"); |
+shouldBeTrue("(function(){({set a(){}, get a(){}})}), true"); |