| Index: test/webkit/fast/js/kde/Prototype.js
|
| diff --git a/test/webkit/regexp-find-first-asserted.js b/test/webkit/fast/js/kde/Prototype.js
|
| similarity index 62%
|
| copy from test/webkit/regexp-find-first-asserted.js
|
| copy to test/webkit/fast/js/kde/Prototype.js
|
| index ce8628fd35dd34b181d0376933fe82ac747f6e5d..a2971fde189cb31d099c08b956607cba5ad3ecd4 100644
|
| --- a/test/webkit/regexp-find-first-asserted.js
|
| +++ b/test/webkit/fast/js/kde/Prototype.js
|
| @@ -21,11 +21,38 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -description(
|
| -'Tests some regular expressions that were doing the wrong thing with the "find first asserted" optimization.'
|
| -);
|
| +description("KDE JS Test");
|
| +///////////////////////////////////////////////////////
|
|
|
| -shouldBe('/.*<body>(.*)<\\/body>.*/.exec("foo<body>bar</body>baz").toString()', '"foo<body>bar</body>baz,bar"');
|
| -shouldBe('/\\s*<!--([\s\S]*)\\/\\/\\s*-->\\s*/.exec("<!--// -->").toString()', '"<!--// -->,"');
|
| +function Square(x)
|
| +{
|
| + this.x = x;
|
| +}
|
|
|
| -debug('');
|
| +new Square(0); // create prototype
|
| +
|
| +function Square_area() { return this.x * this.x; }
|
| +Square.prototype.area = Square_area;
|
| +var s = new Square(3);
|
| +shouldBe("s.area()", "9");
|
| +
|
| +///////////////////////////////////////////////////////
|
| +
|
| +function Item(name){
|
| + this.name = name;
|
| +}
|
| +
|
| +function Book(name, author){
|
| + this.base = Item; // set Item constructor as method of Book object
|
| + this.base(name); // set the value of name property
|
| + this.author = author;
|
| +}
|
| +Book.prototype = new Item;
|
| +var b = new Book("a book", "Fred"); // create object instance
|
| +//edebug(e"b.name"));
|
| +shouldBe("b.name", "'a book'");
|
| +shouldBe("b.author", "'Fred'"); // outpus "Fred"
|
| +
|
| +///////////////////////////////////////////////////////
|
| +
|
| +shouldBe("delete Boolean.prototype", "false");
|
|
|