Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Unified Diff: test/mjsunit/es6/super.js

Issue 1424233005: Fix another corner-case behavior of Object::SetSuperProperty. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove should_throw argument of SetDataProperty. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/harmony/reflect.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/super.js
diff --git a/test/mjsunit/es6/super.js b/test/mjsunit/es6/super.js
index 355cbdd7d651bd31f1ed62174f1332f459d6c217..4301f69e43c67ad12521236cd46afdb021dca6b5 100644
--- a/test/mjsunit/es6/super.js
+++ b/test/mjsunit/es6/super.js
@@ -939,12 +939,8 @@
mSloppy() {
assertEquals(42, this.ownReadOnly);
super.ownReadOnly = 55;
- assertEquals(55, this.ownReadOnly);
- var descr = Object.getOwnPropertyDescriptor(this, 'ownReadOnly');
- assertEquals(55, descr.value);
- assertTrue(descr.configurable);
- assertFalse(descr.enumerable);
- assertFalse(descr.writable);
+ assertSame(undefined, super.ownReadOnly);
+ assertEquals(42, this.ownReadOnly);
assertFalse(Base.prototype.hasOwnProperty('ownReadOnly'));
assertEquals(15, this.ownReadonlyAccessor);
@@ -962,13 +958,9 @@
mStrict() {
'use strict';
assertEquals(42, this.ownReadOnly);
- super.ownReadOnly = 55;
- assertEquals(55, this.ownReadOnly);
- var descr = Object.getOwnPropertyDescriptor(this, 'ownReadOnly');
- assertEquals(55, descr.value);
- assertTrue(descr.configurable);
- assertFalse(descr.enumerable);
- assertFalse(descr.writable);
+ assertThrows(() => {super.ownReadOnly = 55}, TypeError);
+ assertSame(undefined, super.ownReadOnly);
+ assertEquals(42, this.ownReadOnly);
assertFalse(Base.prototype.hasOwnProperty('ownReadOnly'));
assertEquals(15, this.ownReadonlyAccessor);
@@ -1167,12 +1159,8 @@ function TestKeyedSetterCreatingOwnPropertiesReconfigurable(ownReadOnly,
mSloppy() {
assertEquals(42, this[ownReadOnly]);
super[ownReadOnly] = 55;
- assertEquals(55, this[ownReadOnly]);
- var descr = Object.getOwnPropertyDescriptor(this, ownReadOnly);
- assertEquals(55, descr.value);
- assertTrue(descr.configurable);
- assertFalse(descr.enumerable);
- assertFalse(descr.writable);
+ assertSame(undefined, super[ownReadOnly]);
+ assertEquals(42, this[ownReadOnly]);
assertFalse(Base.prototype.hasOwnProperty(ownReadOnly));
assertEquals(15, this[ownReadonlyAccessor]);
@@ -1190,13 +1178,9 @@ function TestKeyedSetterCreatingOwnPropertiesReconfigurable(ownReadOnly,
mStrict() {
'use strict';
assertEquals(42, this[ownReadOnly]);
- super[ownReadOnly] = 55;
- assertEquals(55, this[ownReadOnly]);
- var descr = Object.getOwnPropertyDescriptor(this, ownReadOnly);
- assertEquals(55, descr.value);
- assertTrue(descr.configurable);
- assertFalse(descr.enumerable);
- assertFalse(descr.writable);
+ assertThrows(() => {super[ownReadOnly] = 55}, TypeError);
+ assertSame(undefined, super[ownReadOnly]);
+ assertEquals(42, this[ownReadOnly]);
assertFalse(Base.prototype.hasOwnProperty(ownReadOnly));
assertEquals(15, this[ownReadonlyAccessor]);
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/harmony/reflect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698