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

Unified Diff: test/mjsunit/es6/classes-subclass-builtins.js

Issue 1773653002: [strong] Remove all remainders of strong mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oversight Created 4 years, 9 months 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 | « test/cctest/test-parsing.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/classes-subclass-builtins.js
diff --git a/test/mjsunit/es6/classes-subclass-builtins.js b/test/mjsunit/es6/classes-subclass-builtins.js
index 75217ff13466f2c2a8fc21997900b3f45aa8d10e..41a92918793ca574b8ef4bb8c095b1d3f8353663 100644
--- a/test/mjsunit/es6/classes-subclass-builtins.js
+++ b/test/mjsunit/es6/classes-subclass-builtins.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --allow-natives-syntax --harmony-reflect --harmony-regexp-subclass
-// Flags: --expose-gc --strong-mode
+// Flags: --expose-gc
"use strict";
@@ -90,26 +90,24 @@ function checkPrototypeChain(object, constructors) {
assertNull(Object.getOwnPropertyDescriptor(sloppy_func, "caller").value);
assertEquals(undefined, Object.getOwnPropertyDescriptor(strict_func, "caller"));
- function CheckFunction(func, is_strong) {
+ function CheckFunction(func) {
assertEquals("function", typeof func);
assertTrue(func instanceof Object);
assertTrue(func instanceof Function);
assertTrue(func instanceof A);
checkPrototypeChain(func, [A, Function, Object]);
- if (!is_strong) {
- assertEquals(42, func.a);
- assertEquals(4.2, func.d);
- assertEquals(153, func.o.foo);
- assertTrue(undefined !== func.prototype);
- func.prototype.bar = "func.bar";
- var obj = new func();
- assertTrue(obj instanceof Object);
- assertTrue(obj instanceof func);
- assertEquals("object", typeof obj);
- assertEquals(113, obj.foo);
- assertEquals("func.bar", obj.bar);
- delete func.prototype.bar;
- }
+ assertEquals(42, func.a);
+ assertEquals(4.2, func.d);
+ assertEquals(153, func.o.foo);
+ assertTrue(undefined !== func.prototype);
+ func.prototype.bar = "func.bar";
+ var obj = new func();
+ assertTrue(obj instanceof Object);
+ assertTrue(obj instanceof func);
+ assertEquals("object", typeof obj);
+ assertEquals(113, obj.foo);
+ assertEquals("func.bar", obj.bar);
+ delete func.prototype.bar;
}
var source = "this.foo = 113;";
@@ -130,15 +128,6 @@ function checkPrototypeChain(object, constructors) {
var strict_func1 = new A("'use strict'; return 312;");
assertTrue(%HaveSameMap(strict_func, strict_func1));
- // Strong function
- var strong_func = new A("'use strong'; " + source);
- assertFalse(%HaveSameMap(strong_func, sloppy_func));
- assertFalse(%HaveSameMap(strong_func, strict_func));
- CheckFunction(strong_func, true);
-
- var strong_func1 = new A("'use strong'; return 312;");
- assertTrue(%HaveSameMap(strong_func, strong_func1));
-
gc();
})();
@@ -587,11 +576,6 @@ function TestMapSetSubclassing(container, is_map) {
constructor(...args) {
assertFalse(new.target === undefined);
super(...args);
- // Strong functions are not extensible, so don't add fields.
- if (args[args.length - 1].indexOf("use strong") >= 0) {
- assertThrows(()=>{ this.a = 10; }, TypeError);
- return;
- }
this.a = 42;
this.d = 4.2;
this.o = {foo:153};
@@ -605,35 +589,34 @@ function TestMapSetSubclassing(container, is_map) {
assertEquals(undefined, Object.getOwnPropertyDescriptor(sloppy_func, "caller"));
assertEquals(undefined, Object.getOwnPropertyDescriptor(strict_func, "caller"));
- function CheckFunction(func, is_strong) {
+ function CheckFunction(func) {
assertEquals("function", typeof func);
assertTrue(func instanceof Object);
assertTrue(func instanceof Function);
assertTrue(func instanceof GeneratorFunction);
assertTrue(func instanceof A);
checkPrototypeChain(func, [A, GeneratorFunction, Function, Object]);
- if (!is_strong) {
- assertEquals(42, func.a);
- assertEquals(4.2, func.d);
- assertEquals(153, func.o.foo);
-
- assertTrue(undefined !== func.prototype);
- func.prototype.bar = "func.bar";
- var obj = func(); // Generator object.
- assertTrue(obj instanceof Object);
- assertTrue(obj instanceof func);
- assertEquals("object", typeof obj);
- assertEquals("func.bar", obj.bar);
- delete func.prototype.bar;
-
- assertPropertiesEqual({done: false, value: 1}, obj.next());
- assertPropertiesEqual({done: false, value: 1}, obj.next());
- assertPropertiesEqual({done: false, value: 2}, obj.next());
- assertPropertiesEqual({done: false, value: 3}, obj.next());
- assertPropertiesEqual({done: false, value: 5}, obj.next());
- assertPropertiesEqual({done: false, value: 8}, obj.next());
- assertPropertiesEqual({done: true, value: undefined}, obj.next());
- }
+
+ assertEquals(42, func.a);
+ assertEquals(4.2, func.d);
+ assertEquals(153, func.o.foo);
+
+ assertTrue(undefined !== func.prototype);
+ func.prototype.bar = "func.bar";
+ var obj = func(); // Generator object.
+ assertTrue(obj instanceof Object);
+ assertTrue(obj instanceof func);
+ assertEquals("object", typeof obj);
+ assertEquals("func.bar", obj.bar);
+ delete func.prototype.bar;
+
+ assertPropertiesEqual({done: false, value: 1}, obj.next());
+ assertPropertiesEqual({done: false, value: 1}, obj.next());
+ assertPropertiesEqual({done: false, value: 2}, obj.next());
+ assertPropertiesEqual({done: false, value: 3}, obj.next());
+ assertPropertiesEqual({done: false, value: 5}, obj.next());
+ assertPropertiesEqual({done: false, value: 8}, obj.next());
+ assertPropertiesEqual({done: true, value: undefined}, obj.next());
}
var source = "yield 1; yield 1; yield 2; yield 3; yield 5; yield 8;";
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698