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

Unified Diff: src/collection.js

Issue 21924007: Make new Harmony constructors subclassing-friendly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « src/arraybuffer.js ('k') | src/messages.js » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index 01537e87b0973cee8a65fc759c17fad43fbf7387..deb1a8d902a2dfcbeb97c4902aa10139c233127d 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -44,11 +44,7 @@ var undefined_sentinel = {};
// Harmony Set
function SetConstructor() {
- if (%_IsConstructCall()) {
- %SetInitialize(this);
- } else {
- throw MakeTypeError('constructor_not_function', ['Set']);
- }
+ %SetInitialize(this);
}
@@ -108,7 +104,7 @@ function SetClear() {
['Set.prototype.clear', this]);
}
// Replace the internal table with a new empty table.
- %SetInitialize(this);
+ %SetClear(this);
}
@@ -138,11 +134,7 @@ SetUpSet();
// Harmony Map
function MapConstructor() {
- if (%_IsConstructCall()) {
- %MapInitialize(this);
- } else {
- throw MakeTypeError('constructor_not_function', ['Map']);
- }
+ %MapInitialize(this);
}
@@ -209,7 +201,7 @@ function MapClear() {
['Map.prototype.clear', this]);
}
// Replace the internal table with a new empty table.
- %MapInitialize(this);
+ %MapClear(this);
}
@@ -240,11 +232,7 @@ SetUpMap();
// Harmony WeakMap
function WeakMapConstructor() {
- if (%_IsConstructCall()) {
- %WeakCollectionInitialize(this);
- } else {
- throw MakeTypeError('constructor_not_function', ['WeakMap']);
- }
+ %WeakMapInitialize(this);
}
@@ -302,7 +290,7 @@ function WeakMapClear() {
['WeakMap.prototype.clear', this]);
}
// Replace the internal table with a new empty table.
- %WeakCollectionInitialize(this);
+ %WeakCollectionClear(this);
}
@@ -332,11 +320,7 @@ SetUpWeakMap();
// Harmony WeakSet
function WeakSetConstructor() {
- if (%_IsConstructCall()) {
- %WeakCollectionInitialize(this);
- } else {
- throw MakeTypeError('constructor_not_function', ['WeakSet']);
- }
+ %WeakSetInitialize(this);
}
@@ -382,7 +366,7 @@ function WeakSetClear() {
['WeakSet.prototype.clear', this]);
}
// Replace the internal table with a new empty table.
- %WeakCollectionInitialize(this);
+ %WeakCollectionClear(this);
}
« no previous file with comments | « src/arraybuffer.js ('k') | src/messages.js » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698