Commit 0c305e0b authored by adamk's avatar adamk Committed by Commit bot

Fix error message for Object.observe accept argument

BUG=chromium:464695
LOG=n

Review URL: https://codereview.chromium.org/1005553003

Cr-Commit-Position: refs/heads/master@{#27171}
parent a1a20462
......@@ -81,7 +81,7 @@ var kMessages = {
observe_non_object: ["Object.", "%0", " cannot ", "%0", " non-object"],
observe_non_function: ["Object.", "%0", " cannot deliver to non-function"],
observe_callback_frozen: ["Object.observe cannot deliver to a frozen function object"],
observe_invalid_accept: ["Object.observe accept must be an array of strings."],
observe_invalid_accept: ["Third argument to Object.observe must be an array of strings."],
observe_type_non_string: ["Invalid changeRecord with non-string 'type' property"],
observe_perform_non_string: ["Invalid non-string changeType"],
observe_perform_non_function: ["Cannot perform non-function"],
......
......@@ -271,7 +271,7 @@ function ConvertAcceptListToTypeMap(arg) {
return arg;
if (!IS_SPEC_OBJECT(arg))
throw MakeTypeError("observe_accept_invalid");
throw MakeTypeError("observe_invalid_accept");
var len = ToInteger(arg.length);
if (len < 0) len = 0;
......
......@@ -1824,3 +1824,16 @@ for (var b1 = 0; b1 < 2; ++b1)
{ object: fun, type: 'add', name: 'name' },
]);
})();
(function TestObserveInvalidAcceptMessage() {
var ex;
try {
Object.observe({}, function(){}, "not an object");
} catch (e) {
ex = e;
}
assertInstanceof(ex, TypeError);
assertEquals("Third argument to Object.observe must be an array of strings.",
ex.message);
})()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment