Reviewers: arv,

Description:
Fix error message for Object.observe accept argument

BUG=chromium:464695
LOG=n

Please review this at https://codereview.chromium.org/1005553003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+14, -1 lines):
  M src/object-observe.js
  M test/mjsunit/es7/object-observe.js


Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index 01ce8054fdd57df55644d1aa4b366115f76dfdf2..3ba917ecda9e6c7d4d75148f83b9775130aacbef 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -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;
Index: test/mjsunit/es7/object-observe.js
diff --git a/test/mjsunit/es7/object-observe.js b/test/mjsunit/es7/object-observe.js index 99fa38a8573f1f2db70b3c2a0875d61132202c8b..a6831c09633a41a385e69307dc7e39538c306faf 100644
--- a/test/mjsunit/es7/object-observe.js
+++ b/test/mjsunit/es7/object-observe.js
@@ -1824,3 +1824,16 @@ for (var b1 = 0; b1 < 2; ++b1)
     { object: fun, type: 'add', name: 'name' },
   ]);
 })();
+
+
+(function TestObserveInvalidAcceptMessage() {
+  try {
+    Object.observe({}, function(){}, "not an object");
+  } catch (e) {
+    assertInstanceof(e, TypeError);
+    assertEquals("Object.observe accept must be an array of strings.",
+                 e.message);
+    return;
+  }
+  fail("TypeError", "no exception");
+})()


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to