From d3e91bee1b5cd8ef0305e92aa93fd7d392b29563 Mon Sep 17 00:00:00 2001 From: "cbegle%netscape.com" Date: Thu, 17 Jun 1999 00:20:04 +0000 Subject: [PATCH] Add regression test for http://bugzilla.mozilla.org/show_bug.cgi?id=7635. Rename files for consistency. These files are not part of the client. --- .../{instanceof-1.js => instanceof-001.js} | 0 .../{instanceof_2.js => instanceof-002.js} | 0 js/tests/ecma_2/instanceof/instanceof-003.js | 46 +++++++++++++++++++ 3 files changed, 46 insertions(+) rename js/tests/ecma_2/instanceof/{instanceof-1.js => instanceof-001.js} (100%) rename js/tests/ecma_2/instanceof/{instanceof_2.js => instanceof-002.js} (100%) create mode 100644 js/tests/ecma_2/instanceof/instanceof-003.js diff --git a/js/tests/ecma_2/instanceof/instanceof-1.js b/js/tests/ecma_2/instanceof/instanceof-001.js similarity index 100% rename from js/tests/ecma_2/instanceof/instanceof-1.js rename to js/tests/ecma_2/instanceof/instanceof-001.js diff --git a/js/tests/ecma_2/instanceof/instanceof_2.js b/js/tests/ecma_2/instanceof/instanceof-002.js similarity index 100% rename from js/tests/ecma_2/instanceof/instanceof_2.js rename to js/tests/ecma_2/instanceof/instanceof-002.js diff --git a/js/tests/ecma_2/instanceof/instanceof-003.js b/js/tests/ecma_2/instanceof/instanceof-003.js new file mode 100644 index 000000000000..1b0a01b5987f --- /dev/null +++ b/js/tests/ecma_2/instanceof/instanceof-003.js @@ -0,0 +1,46 @@ +/** + File Name: instanceof-003.js + ECMA Section: + Description: http://bugzilla.mozilla.org/show_bug.cgi?id=7635 + +js> function Foo() {} +js> theproto = {}; +[object Object] +js> Foo.prototype = theproto +[object Object] +js> theproto instanceof Foo +true + +I think this should be 'false' + + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "instanceof-003"; + var VERSION = "ECMA_2"; + var TITLE = "instanceof operator"; + var BUGNUMBER ="http://bugzilla.mozilla.org/show_bug.cgi?id=7635"; + + startTest(); + + function Foo() {}; + theproto = {}; + Foo.prototype = theproto; + + AddTestCase( + "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " + + "theproto instanceof Foo", + false, + theproto instanceof Foo ); + + + var o = {}; + + AddTestCase( + "o = {}; o instanceof o", + false, + o instanceof o ); + + + test();