diff --git a/js/src/builtin/Utilities.js b/js/src/builtin/Utilities.js index 1dcff5f67917..bfb1fe7f45d0 100644 --- a/js/src/builtin/Utilities.js +++ b/js/src/builtin/Utilities.js @@ -148,7 +148,7 @@ function GetIterator(obj, method) { // Step 5. if (!IsObject(iterator)) - ThrowTypeError(JSMSG_NOT_ITERABLE, ToString(iterator)); + ThrowTypeError(JSMSG_NOT_ITERATOR, ToString(iterator)); // Step 6. return iterator; diff --git a/js/src/js.msg b/js/src/js.msg index 2c422179dc55..abe9509477ea 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -92,6 +92,7 @@ MSG_DEF(JSMSG_BAD_GET_SET_FIELD, 1, JSEXN_TYPEERR, "property descriptor's MSG_DEF(JSMSG_THROW_TYPE_ERROR, 0, JSEXN_TYPEERR, "'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them") MSG_DEF(JSMSG_NOT_EXPECTED_TYPE, 3, JSEXN_TYPEERR, "{0}: expected {1}, got {2}") MSG_DEF(JSMSG_NOT_ITERABLE, 1, JSEXN_TYPEERR, "{0} is not iterable") +MSG_DEF(JSMSG_NOT_ITERATOR, 1, JSEXN_TYPEERR, "{0} is not iterator") MSG_DEF(JSMSG_ALREADY_HAS_PRAGMA, 2, JSEXN_WARN, "{0} is being assigned a {1}, but already has one") MSG_DEF(JSMSG_GET_ITER_RETURNED_PRIMITIVE, 0, JSEXN_TYPEERR, "[Symbol.iterator]() returned a non-object value") MSG_DEF(JSMSG_NEXT_RETURNED_PRIMITIVE, 0, JSEXN_TYPEERR, "iterator.next() returned a non-object value")