summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/v8/test/mjsunit/override-read-only-property.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/v8/test/mjsunit/override-read-only-property.js')
-rw-r--r--src/3rdparty/v8/test/mjsunit/override-read-only-property.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/3rdparty/v8/test/mjsunit/override-read-only-property.js b/src/3rdparty/v8/test/mjsunit/override-read-only-property.js
index b8fa501..2876ae1 100644
--- a/src/3rdparty/v8/test/mjsunit/override-read-only-property.js
+++ b/src/3rdparty/v8/test/mjsunit/override-read-only-property.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --es5_readonly
+
// According to ECMA-262, sections 8.6.2.2 and 8.6.2.3 you're not
// allowed to override read-only properties, not even if the read-only
// property is in the prototype chain.
@@ -38,19 +40,19 @@ F.prototype = Number;
var original_number_max = Number.MAX_VALUE;
// Assignment to a property which does not exist on the object itself,
-// but is read-only in a prototype takes effect.
+// but is read-only in a prototype does not take effect.
var f = new F();
assertEquals(original_number_max, f.MAX_VALUE);
f.MAX_VALUE = 42;
-assertEquals(42, f.MAX_VALUE);
+assertEquals(original_number_max, f.MAX_VALUE);
// Assignment to a property which does not exist on the object itself,
-// but is read-only in a prototype takes effect.
+// but is read-only in a prototype does not take effect.
f = new F();
with (f) {
MAX_VALUE = 42;
}
-assertEquals(42, f.MAX_VALUE);
+assertEquals(original_number_max, f.MAX_VALUE);
// Assignment to read-only property on the object itself is ignored.
Number.MAX_VALUE = 42;