We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f6855f commit c16a6f2Copy full SHA for c16a6f2
1 file changed
tests/src/test/java/org/mozilla/javascript/tests/es6/InstanceofTest.java
@@ -0,0 +1,22 @@
1
+package org.mozilla.javascript.tests.es6;
2
+
3
+import org.junit.Test;
4
+import org.mozilla.javascript.testutils.Utils;
5
6
+/** Test for instanceof operator. */
7
+public class InstanceofTest {
8
9
+ @Test
10
+ public void rightHandSideNotCallable() {
11
+ String js =
12
+ "try {\n"
13
+ + " throw SyntaxError();\n"
14
+ + "} catch (e) {\n"
15
+ + " var value = (e instanceof SyntaxError());\n"
16
+ + "}";
17
18
+ Utils.assertEcmaError(
19
+ "TypeError: Target of ``instanceof`` must be callable or have ``[Symbol.hasInstance]`` method.",
20
+ js);
21
+ }
22
+}
0 commit comments