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

Unified Diff: src/weak-collection.js

Issue 1083083004: Reland "Migrate error messages, part 2." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix for layout test Created 5 years, 8 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/v8natives.js ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/weak-collection.js
diff --git a/src/weak-collection.js b/src/weak-collection.js
index 44faa3ecd8826b770203d7eda2d6e1001f813570..02804aff72e399a0450c79dbcbae4a270756bc90 100644
--- a/src/weak-collection.js
+++ b/src/weak-collection.js
@@ -25,7 +25,7 @@ function WeakMapConstructor(iterable) {
if (!IS_NULL_OR_UNDEFINED(iterable)) {
var adder = this.set;
if (!IS_SPEC_FUNCTION(adder)) {
- throw MakeTypeError(kPropertyNotFunction, ['set', this]);
+ throw MakeTypeError(kPropertyNotFunction, 'set', this);
}
for (var nextItem of iterable) {
if (!IS_SPEC_OBJECT(nextItem)) {
@@ -39,8 +39,8 @@ function WeakMapConstructor(iterable) {
function WeakMapGet(key) {
if (!IS_WEAKMAP(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakMap.prototype.get', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakMap.prototype.get', this);
}
if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
return %WeakCollectionGet(this, key);
@@ -49,8 +49,8 @@ function WeakMapGet(key) {
function WeakMapSet(key, value) {
if (!IS_WEAKMAP(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakMap.prototype.set', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakMap.prototype.set', this);
}
if (!IS_SPEC_OBJECT(key)) {
throw %MakeTypeError('invalid_weakmap_key', [this, key]);
@@ -61,8 +61,8 @@ function WeakMapSet(key, value) {
function WeakMapHas(key) {
if (!IS_WEAKMAP(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakMap.prototype.has', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakMap.prototype.has', this);
}
if (!IS_SPEC_OBJECT(key)) return false;
return %WeakCollectionHas(this, key);
@@ -71,8 +71,8 @@ function WeakMapHas(key) {
function WeakMapDelete(key) {
if (!IS_WEAKMAP(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakMap.prototype.delete', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakMap.prototype.delete', this);
}
if (!IS_SPEC_OBJECT(key)) return false;
return %WeakCollectionDelete(this, key);
@@ -110,7 +110,7 @@ function WeakSetConstructor(iterable) {
if (!IS_NULL_OR_UNDEFINED(iterable)) {
var adder = this.add;
if (!IS_SPEC_FUNCTION(adder)) {
- throw MakeTypeError(kPropertyNotFunction, ['add', this]);
+ throw MakeTypeError(kPropertyNotFunction, 'add', this);
}
for (var value of iterable) {
%_CallFunction(this, value, adder);
@@ -121,8 +121,8 @@ function WeakSetConstructor(iterable) {
function WeakSetAdd(value) {
if (!IS_WEAKSET(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakSet.prototype.add', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakSet.prototype.add', this);
}
if (!IS_SPEC_OBJECT(value)) {
throw %MakeTypeError('invalid_weakset_value', [this, value]);
@@ -133,8 +133,8 @@ function WeakSetAdd(value) {
function WeakSetHas(value) {
if (!IS_WEAKSET(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakSet.prototype.has', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakSet.prototype.has', this);
}
if (!IS_SPEC_OBJECT(value)) return false;
return %WeakCollectionHas(this, value);
@@ -143,8 +143,8 @@ function WeakSetHas(value) {
function WeakSetDelete(value) {
if (!IS_WEAKSET(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakSet.prototype.delete', this]);
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ 'WeakSet.prototype.delete', this);
}
if (!IS_SPEC_OBJECT(value)) return false;
return %WeakCollectionDelete(this, value);
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698