Commit 02a015b1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[es6] Rebaseline tests of 'instanceof' error messages.

This rebaselines all our internal tests for error messages thrown by the
implementation of 'instanceof' to the new ES6 semantics. It also applies
a minor rephrasing to the messages in question.

R=rossberg@chromium.org
BUG=v8:4447
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34940}
parent e2b3d053
......@@ -94,7 +94,8 @@ class CallSite {
T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \
T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \
T(CalledNonCallable, "% is not a function") \
T(CalledNonCallableInstanceOf, "right-hand side is not a function") \
T(CalledNonCallableInstanceOf, \
"Right-hand side of 'instanceof' is not callable") \
T(CalledOnNonObject, "% called on non-object") \
T(CalledOnNullOrUndefined, "% called on null or undefined") \
T(CallSiteExpectsFunction, \
......@@ -147,6 +148,8 @@ class CallSite {
T(NoAccess, "no access") \
T(NonCoercible, "Cannot match against 'undefined' or 'null'.") \
T(NonExtensibleProto, "% is not extensible") \
T(NonObjectInInstanceOfCheck, \
"Right-hand side of 'instanceof' is not an object") \
T(NonObjectPropertyLoad, "Cannot read property '%' of %") \
T(NonObjectPropertyStore, "Cannot set property '%' of %") \
T(NoSetterInCallback, "Cannot set property % of % which has only a getter") \
......@@ -461,7 +464,6 @@ class CallSite {
T(UnterminatedTemplate, "Unterminated template literal") \
T(UnterminatedTemplateExpr, "Missing } in template expression") \
T(FoundNonCallableHasInstance, "Found non-callable @@hasInstance") \
T(NonObjectInInstanceOfCheck, "right-hand side is not an object") \
/* EvalError */ \
T(CodeGenFromStrings, "%") \
/* URIError */ \
......
*%(basename)s:30: TypeError: right-hand side is not a function
*%(basename)s:30: TypeError: Right-hand side of 'instanceof' is not callable
1 instanceof {};
^
TypeError: right-hand side is not a function
TypeError: Right-hand side of 'instanceof' is not callable
at *%(basename)s:30:3
*%(basename)s:30: TypeError: right-hand side is not an object
*%(basename)s:30: TypeError: Right-hand side of 'instanceof' is not an object
1 instanceof 2;
^
TypeError: right-hand side is not an object
TypeError: Right-hand side of 'instanceof' is not an object
at *%(basename)s:30:3
......@@ -150,7 +150,7 @@ TypeError);
// kInstanceofFunctionExpected
test(function() {
1 instanceof 1;
}, "right-hand side is not an object", TypeError);
}, "Right-hand side of 'instanceof' is not an object", TypeError);
// kInstanceofNonobjectProto
test(function() {
......
......@@ -27,7 +27,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS new {}.undefined threw exception TypeError: (intermediate value).undefined is not a constructor.
PASS 1 instanceof {}.undefined threw exception TypeError: Expecting a function in instanceof check, but got undefined.
PASS 1 instanceof {}.undefined threw exception TypeError: Right-hand side of 'instanceof' is not an object.
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -21,6 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-instanceof
description("Test for correct handling of exceptions from instanceof and 'new' expressions");
shouldThrow("new {}.undefined");
......
......@@ -26,12 +26,12 @@ This test makes sure that instance of behaves correctly when the value, construc
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (1 instanceof 1) threw exception TypeError: Expecting a function in instanceof check, but got 1.
PASS ({} instanceof 1) threw exception TypeError: Expecting a function in instanceof check, but got 1.
PASS (obj instanceof 1) threw exception TypeError: Expecting a function in instanceof check, but got 1.
PASS (1 instanceof {}) threw exception TypeError: Expecting a function in instanceof check, but got #<Object>.
PASS ({} instanceof {}) threw exception TypeError: Expecting a function in instanceof check, but got #<Object>.
PASS (obj instanceof {}) threw exception TypeError: Expecting a function in instanceof check, but got #<Object>.
PASS (1 instanceof 1) threw exception TypeError: Right-hand side of 'instanceof' is not an object.
PASS ({} instanceof 1) threw exception TypeError: Right-hand side of 'instanceof' is not an object.
PASS (obj instanceof 1) threw exception TypeError: Right-hand side of 'instanceof' is not an object.
PASS (1 instanceof {}) threw exception TypeError: Right-hand side of 'instanceof' is not callable.
PASS ({} instanceof {}) threw exception TypeError: Right-hand side of 'instanceof' is not callable.
PASS (obj instanceof {}) threw exception TypeError: Right-hand side of 'instanceof' is not callable.
PASS (1 instanceof Constructor) is false
PASS ({} instanceof Constructor) is false
PASS (obj instanceof Constructor) is true
......
......@@ -21,6 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-instanceof
description('This test makes sure that instance of behaves correctly when the value, constructor, or its prototype are immediates.');
// A Constructor to use check for instances of, and an instance called obj.
......
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