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

Unified Diff: src/js/collection.js

Issue 2222893002: Move family of MakeError functions to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix in prologue.js Created 4 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
Index: src/js/collection.js
diff --git a/src/js/collection.js b/src/js/collection.js
index be6afe0ccfd7d8f251eead6f99b037b933a29ae5..83763af860bdbd2ae2cea40e1e0ddabb570765f4 100644
--- a/src/js/collection.js
+++ b/src/js/collection.js
@@ -15,7 +15,6 @@ var GlobalObject = global.Object;
var GlobalSet = global.Set;
var hashCodeSymbol = utils.ImportNow("hash_code_symbol");
var MathRandom;
-var MakeTypeError;
var MapIterator;
var NumberIsNaN;
var SetIterator;
@@ -24,7 +23,6 @@ var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathRandom = from.MathRandom;
- MakeTypeError = from.MakeTypeError;
MapIterator = from.MapIterator;
NumberIsNaN = from.NumberIsNaN;
SetIterator = from.SetIterator;
@@ -127,7 +125,7 @@ function GetHash(key) {
function SetConstructor(iterable) {
if (IS_UNDEFINED(new.target)) {
- throw MakeTypeError(kConstructorNotFunction, "Set");
+ throw %make_type_error(kConstructorNotFunction, "Set");
}
%_SetInitialize(this);
@@ -135,7 +133,7 @@ function SetConstructor(iterable) {
if (!IS_NULL_OR_UNDEFINED(iterable)) {
var adder = this.add;
if (!IS_CALLABLE(adder)) {
- throw MakeTypeError(kPropertyNotFunction, adder, 'add', this);
+ throw %make_type_error(kPropertyNotFunction, adder, 'add', this);
}
for (var value of iterable) {
@@ -147,7 +145,7 @@ function SetConstructor(iterable) {
function SetAdd(key) {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver, 'Set.prototype.add', this);
+ throw %make_type_error(kIncompatibleMethodReceiver, 'Set.prototype.add', this);
}
// Normalize -0 to +0 as required by the spec.
// Even though we use SameValueZero as the comparison for the keys we don't
@@ -187,7 +185,7 @@ function SetAdd(key) {
function SetHas(key) {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver, 'Set.prototype.has', this);
+ throw %make_type_error(kIncompatibleMethodReceiver, 'Set.prototype.has', this);
}
var table = %_JSCollectionGetTable(this);
var numBuckets = ORDERED_HASH_TABLE_BUCKET_COUNT(table);
@@ -199,7 +197,7 @@ function SetHas(key) {
function SetDelete(key) {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Set.prototype.delete', this);
}
var table = %_JSCollectionGetTable(this);
@@ -222,7 +220,7 @@ function SetDelete(key) {
function SetGetSize() {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Set.prototype.size', this);
}
var table = %_JSCollectionGetTable(this);
@@ -232,7 +230,7 @@ function SetGetSize() {
function SetClearJS() {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Set.prototype.clear', this);
}
%_SetClear(this);
@@ -241,11 +239,11 @@ function SetClearJS() {
function SetForEach(f, receiver) {
if (!IS_SET(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Set.prototype.forEach', this);
}
- if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
+ if (!IS_CALLABLE(f)) throw %make_type_error(kCalledNonCallable, f);
var iterator = new SetIterator(this, ITERATOR_KIND_VALUES);
var key;
@@ -291,7 +289,7 @@ utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [
function MapConstructor(iterable) {
if (IS_UNDEFINED(new.target)) {
- throw MakeTypeError(kConstructorNotFunction, "Map");
+ throw %make_type_error(kConstructorNotFunction, "Map");
}
%_MapInitialize(this);
@@ -299,12 +297,12 @@ function MapConstructor(iterable) {
if (!IS_NULL_OR_UNDEFINED(iterable)) {
var adder = this.set;
if (!IS_CALLABLE(adder)) {
- throw MakeTypeError(kPropertyNotFunction, adder, 'set', this);
+ throw %make_type_error(kPropertyNotFunction, adder, 'set', this);
}
for (var nextItem of iterable) {
if (!IS_RECEIVER(nextItem)) {
- throw MakeTypeError(kIteratorValueNotAnObject, nextItem);
+ throw %make_type_error(kIteratorValueNotAnObject, nextItem);
}
%_Call(adder, this, nextItem[0], nextItem[1]);
}
@@ -314,7 +312,7 @@ function MapConstructor(iterable) {
function MapGet(key) {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.get', this);
}
var table = %_JSCollectionGetTable(this);
@@ -329,7 +327,7 @@ function MapGet(key) {
function MapSet(key, value) {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.set', this);
}
// Normalize -0 to +0 as required by the spec.
@@ -377,7 +375,7 @@ function MapSet(key, value) {
function MapHas(key) {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.has', this);
}
var table = %_JSCollectionGetTable(this);
@@ -389,7 +387,7 @@ function MapHas(key) {
function MapDelete(key) {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.delete', this);
}
var table = %_JSCollectionGetTable(this);
@@ -412,7 +410,7 @@ function MapDelete(key) {
function MapGetSize() {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.size', this);
}
var table = %_JSCollectionGetTable(this);
@@ -422,7 +420,7 @@ function MapGetSize() {
function MapClearJS() {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.clear', this);
}
%_MapClear(this);
@@ -431,11 +429,11 @@ function MapClearJS() {
function MapForEach(f, receiver) {
if (!IS_MAP(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
+ throw %make_type_error(kIncompatibleMethodReceiver,
'Map.prototype.forEach', this);
}
- if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
+ if (!IS_CALLABLE(f)) throw %make_type_error(kCalledNonCallable, f);
var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES);
var value_array = [UNDEFINED, UNDEFINED];
« src/bootstrapper.cc ('K') | « src/js/arraybuffer.js ('k') | src/js/collection-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698