blob: 463862bd0e89ebe0d91ece6850e0935a8d5d890c [file] [log] [blame]
description(
'Test for regression against <a href="https://bugs.webkit.org/show_bug.cgi?id=95815">'
);
function testPostIncConstVarWithIgnoredResult()
{
var okay = false;
const a = {
valueOf: (function(){
okay = true;
})
};
a++;
return okay;
}
function testPreIncConstVarWithIgnoredResult()
{
var okay = false;
const a = {
valueOf: (function(){
okay = true;
})
};
++a;
return okay;
}
function testPreIncConstVarWithAssign()
{
var okay = false;
var x = 42;
const a = {
valueOf: (function(){
throw x == 42;
})
};
try {
x = ++a;
} catch (e) {
okay = e
};
return okay;
}
shouldBeTrue('testPostIncConstVarWithIgnoredResult()');
shouldBeTrue('testPreIncConstVarWithIgnoredResult()');
shouldBeTrue('testPreIncConstVarWithAssign()');
successfullyParsed = true;