summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/script-tests/object-extra-comma.js
blob: 7e4a4f20e7cda6aec88cab740b63486de13d5a42 (plain)
1
2
3
4
5
6
7
8
9
10
description(
    'This test checks some object construction cases, including ' +
    '<a href="https://bugs.webkit.org/show_bug.cgi?id=5939">5939: final comma in javascript object prevents parsing</a>' +
    '.');

shouldBe("var foo = { 'bar' : 'YES' }; foo.bar", "'YES'");
shouldBe("var foo = { 'bar' : 'YES', }; foo.bar", "'YES'");
shouldBe("var foo = { 'bar' : 'YES' , }; foo.bar", "'YES'");
shouldThrow("var foo = { , 'bar' : 'YES' }; foo.bar");
shouldThrow("var foo = { 'bar' : 'YES',, }; foo.bar");