Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / inc-const-valueOf.js
blob463862bd0e89ebe0d91ece6850e0935a8d5d890c
1 description(
2 'Test for regression against <a href="https://bugs.webkit.org/show_bug.cgi?id=95815">'
3 );
5 function testPostIncConstVarWithIgnoredResult()
7 var okay = false;
8 const a = {
9 valueOf: (function(){
10 okay = true;
14 a++;
16 return okay;
19 function testPreIncConstVarWithIgnoredResult()
21 var okay = false;
22 const a = {
23 valueOf: (function(){
24 okay = true;
28 ++a;
30 return okay;
33 function testPreIncConstVarWithAssign()
35 var okay = false;
36 var x = 42;
37 const a = {
38 valueOf: (function(){
39 throw x == 42;
43 try {
44 x = ++a;
45 } catch (e) {
46 okay = e
49 return okay;
52 shouldBeTrue('testPostIncConstVarWithIgnoredResult()');
53 shouldBeTrue('testPreIncConstVarWithIgnoredResult()');
54 shouldBeTrue('testPreIncConstVarWithAssign()');
56 successfullyParsed = true;