├── .gitignore ├── AUTHORS ├── LICENSE ├── Paper Examples ├── Function-prototype.png ├── Safe Subset.txt ├── Testing Adequacy │ ├── Testing with Chrome.txt │ ├── Testing with Firefox.txt │ └── Testing with Rhino.txt ├── array-processing.js ├── constructors.js ├── dog-lab.js ├── functions-as-objects.js ├── functions-objects-state.ss ├── globals.html ├── instanceof.js ├── js ├── locals.js ├── primitives.js ├── this.html └── unsafe-lookup.html ├── README.md ├── Redex ├── direct-tests.ss ├── interp-shell.ss ├── interp.ss ├── js-delta.ss ├── js-redex-testing.ss ├── jscore.ss ├── redex-shell.ss └── test-shell.ss ├── coq ├── Datatypes.v ├── LambdaJS.v ├── LambdaJS_Defs.v ├── LambdaJS_Tactics.v ├── ListExt.v ├── SfLib.v └── configure └── haskell ├── LambdaJS.cabal ├── Setup.hs ├── Tests ├── RemovedTests │ ├── Permanent │ │ ├── Array │ │ │ ├── 15.4.4.4-001.js │ │ │ ├── 15.4.5.1-01.js │ │ │ ├── 15.5.4.8-01.js │ │ │ ├── regress-101488.js │ │ │ ├── regress-130451.js │ │ │ ├── regress-322135-01.js │ │ │ ├── regress-322135-02.js │ │ │ ├── regress-322135-03.js │ │ │ ├── regress-322135-04.js │ │ │ └── regress-387501.js │ │ ├── Exceptions │ │ │ ├── 15.11.1.1.js │ │ │ ├── 15.11.4.4-1.js │ │ │ └── regress-181914.js │ │ ├── ExecutionContexts │ │ │ ├── 10.1.3-2.js │ │ │ ├── 10.1.4-1.js │ │ │ └── 10.6.1-01.js │ │ ├── Expressions │ │ │ ├── 11.6.1-1.js │ │ │ └── 11.9.6-1.js │ │ ├── FunExpr │ │ │ └── fe-001-n.js │ │ ├── Function │ │ │ ├── call-001.js │ │ │ ├── regress-131964.js │ │ │ ├── regress-193555.js │ │ │ ├── regress-49286.js │ │ │ └── regress-58274.js │ │ ├── Number │ │ │ ├── 15.7.4.2-01.js │ │ │ ├── 15.7.4.3-01.js │ │ │ ├── 15.7.4.5-1.js │ │ │ ├── 15.7.4.6-1.js │ │ │ ├── 15.7.4.7-1.js │ │ │ ├── 15.7.4.7-2.js │ │ │ └── regress-442242-01.js │ │ ├── Object │ │ │ ├── 8.6.1-01.js │ │ │ ├── 8.6.2.6-002.js │ │ │ ├── regress-385393-07.js │ │ │ └── regress-72773.js │ │ ├── Operators │ │ │ ├── 11.13.1-001.js │ │ │ └── order-01.js │ │ ├── RegExp │ │ │ ├── 15.10.2-1.js │ │ │ ├── 15.10.2.12.js │ │ │ ├── 15.10.3.1-1.js │ │ │ ├── 15.10.3.1-2.js │ │ │ ├── 15.10.4.1-1.js │ │ │ ├── 15.10.4.1-2.js │ │ │ ├── 15.10.4.1-3.js │ │ │ ├── 15.10.4.1-4.js │ │ │ ├── 15.10.4.1-5-n.js │ │ │ ├── 15.10.4.1-6.js │ │ │ ├── 15.10.6.2-1.js │ │ │ ├── 15.10.6.2-2.js │ │ │ ├── jstests.list │ │ │ ├── octal-001.js │ │ │ ├── octal-002.js │ │ │ ├── perlstress-001.js │ │ │ ├── perlstress-002.js │ │ │ ├── regress-100199.js │ │ │ ├── regress-105972.js │ │ │ ├── regress-119909.js │ │ │ ├── regress-122076.js │ │ │ ├── regress-123437.js │ │ │ ├── regress-165353.js │ │ │ ├── regress-169497.js │ │ │ ├── regress-169534.js │ │ │ ├── regress-187133.js │ │ │ ├── regress-188206.js │ │ │ ├── regress-191479.js │ │ │ ├── regress-202564.js │ │ │ ├── regress-209067.js │ │ │ ├── regress-209919.js │ │ │ ├── regress-216591.js │ │ │ ├── regress-220367-001.js │ │ │ ├── regress-223273.js │ │ │ ├── regress-223535.js │ │ │ ├── regress-224676.js │ │ │ ├── regress-225289.js │ │ │ ├── regress-225343.js │ │ │ ├── regress-24712.js │ │ │ ├── regress-285219.js │ │ │ ├── regress-28686.js │ │ │ ├── regress-289669.js │ │ │ ├── regress-307456.js │ │ │ ├── regress-309840.js │ │ │ ├── regress-311414.js │ │ │ ├── regress-312351.js │ │ │ ├── regress-31316.js │ │ │ ├── regress-330684.js │ │ │ ├── regress-334158.js │ │ │ ├── regress-346090.js │ │ │ ├── regress-367888.js │ │ │ ├── regress-375642.js │ │ │ ├── regress-375711.js │ │ │ ├── regress-375715-01-n.js │ │ │ ├── regress-375715-02.js │ │ │ ├── regress-375715-03.js │ │ │ ├── regress-375715-04.js │ │ │ ├── regress-436700.js │ │ │ ├── regress-465862.js │ │ │ ├── regress-57572.js │ │ │ ├── regress-57631.js │ │ │ ├── regress-67773.js │ │ │ ├── regress-72964.js │ │ │ ├── regress-76683.js │ │ │ ├── regress-78156.js │ │ │ ├── regress-85721.js │ │ │ ├── regress-87231.js │ │ │ ├── regress-98306.js │ │ │ └── shell.js │ │ ├── Regress │ │ │ ├── regress-385393-04.js │ │ │ └── regress-420610.js │ │ ├── Statements │ │ │ ├── regress-121744.js │ │ │ ├── regress-157509.js │ │ │ ├── regress-194364.js │ │ │ ├── regress-302439.js │ │ │ ├── regress-324650.js │ │ │ ├── regress-444979.js │ │ │ ├── regress-74474-002.js │ │ │ ├── regress-74474-003.js │ │ │ └── regress-83532-002.js │ │ ├── String │ │ │ ├── 15.5.4.11.js │ │ │ ├── 15.5.4.14.js │ │ │ ├── regress-104375.js │ │ │ ├── regress-189898.js │ │ │ ├── regress-304376.js │ │ │ ├── regress-392378.js │ │ │ └── regress-83293.js │ │ └── Unicode │ │ │ ├── jstests.list │ │ │ ├── regress-352044-01.js │ │ │ ├── regress-352044-02-n.js │ │ │ ├── shell.js │ │ │ ├── uc-001-n.js │ │ │ ├── uc-001.js │ │ │ ├── uc-002-n.js │ │ │ ├── uc-002.js │ │ │ ├── uc-003.js │ │ │ ├── uc-004.js │ │ │ └── uc-005.js │ ├── README.txt │ └── Temporary │ │ ├── Date │ │ ├── 15.9.1.2-01.js │ │ ├── 15.9.3.2-1.js │ │ ├── 15.9.4.3.js │ │ ├── 15.9.5.3.js │ │ ├── 15.9.5.4.js │ │ ├── 15.9.5.5-02.js │ │ ├── 15.9.5.5.js │ │ ├── 15.9.5.6.js │ │ ├── 15.9.5.7.js │ │ ├── jstests.list │ │ ├── regress-452786.js │ │ └── shell.js │ │ ├── Exceptions │ │ ├── 15.11.7.6-001.js │ │ ├── 15.11.7.6-002.js │ │ ├── 15.11.7.6-003.js │ │ ├── binding-001.js │ │ ├── regress-181654.js │ │ └── regress-95101.js │ │ ├── ExecutionContexts │ │ └── 10.1.3-1 │ │ ├── FunExpr │ │ └── fe-001.js │ │ ├── Function │ │ ├── 15.3.4.3-1.js │ │ ├── 15.3.4.4-1.js │ │ ├── regress-313570.js │ │ ├── regress-85880.js │ │ └── scope-001.js │ │ ├── LexicalConventions │ │ ├── 7.4-01.js │ │ ├── 7.8.3-01.js │ │ ├── 7.9.1.js │ │ ├── jstests.list │ │ └── shell.js │ │ ├── Number │ │ └── 15.7.4.5-2.js │ │ ├── NumberFormatting │ │ ├── jstests.list │ │ ├── shell.js │ │ └── tostring-001.js │ │ └── Regress │ │ └── regress-419152.js ├── SpiderMonkey │ ├── Array │ │ ├── 15.4.4.11-01.js │ │ ├── 15.4.4.3-1.js │ │ ├── jstests.list │ │ ├── regress-421325.js │ │ ├── regress-430717.js │ │ ├── regress-488989.js │ │ └── shell.js │ ├── Exceptions │ │ ├── jstests.list │ │ ├── regress-58946.js │ │ └── shell.js │ ├── ExecutionContexts │ │ ├── 10.1.3.js │ │ ├── jstests.list │ │ ├── regress-23346.js │ │ ├── regress-448595-01.js │ │ └── shell.js │ ├── Expressions │ │ ├── 11.10-01.js │ │ ├── 11.10-02.js │ │ ├── 11.10-03.js │ │ ├── 11.7.1-01.js │ │ ├── 11.7.2-01.js │ │ ├── 11.7.3-01.js │ │ ├── jstests.list │ │ └── shell.js │ ├── FunExpr │ │ ├── fe-002.js │ │ ├── jstests.list │ │ ├── regress-518103.js │ │ └── shell.js │ ├── Function │ │ ├── arguments-001.js │ │ ├── arguments-002.js │ │ ├── jstests.list │ │ ├── regress-137181.js │ │ ├── regress-94506.js │ │ ├── regress-97921.js │ │ ├── scope-002.js │ │ └── shell.js │ ├── Number │ │ ├── 15.7.4.3-02.js │ │ ├── jstests.list │ │ └── shell.js │ ├── Object │ │ ├── 8.6.2.6-001.js │ │ ├── class-001.js │ │ ├── class-002.js │ │ ├── class-003.js │ │ ├── class-004.js │ │ ├── class-005.js │ │ ├── jstests.list │ │ ├── regress-361274.js │ │ ├── regress-459405.js │ │ ├── regress-79129-001.js │ │ └── shell.js │ ├── Operators │ │ ├── 11.13.1-002.js │ │ ├── 11.4.1-001.js │ │ ├── 11.4.1-002.js │ │ ├── jstests.list │ │ └── shell.js │ ├── Readme.txt │ ├── Regress │ │ ├── jstests.list │ │ ├── regress-420087.js │ │ ├── regress-441477-01.js │ │ ├── regress-469937.js │ │ └── shell.js │ ├── Statements │ │ ├── 12.10-01.js │ │ ├── 12.6.3.js │ │ ├── regress-131348.js │ │ ├── regress-226517.js │ │ ├── regress-74474-001.js │ │ ├── regress-83532-001.js │ │ ├── shell.js │ │ └── switch-001.js │ ├── String │ │ ├── jstests.list │ │ ├── regress-313567.js │ │ └── shell.js │ └── shell.js ├── UnitTests │ ├── arrays.tst │ ├── basic.tst │ ├── delete.tst │ ├── exceptions.tst │ ├── forin.tst │ ├── functions.tst │ ├── math.tst │ ├── objects.tst │ ├── operators.tst │ ├── strings.tst │ ├── trycatch.tst │ ├── with.tst │ └── with2.tst ├── all_spidermonkey_tests.sh ├── assemble_spidermonkey_test.py ├── impl.lambdajs ├── impl.rhino ├── onedir_spidermonkey_tests.sh ├── rhino-1_5R5.jar ├── run_onefile_many.js └── spidermonkey_test.sh ├── data └── prelude.js ├── desugar.sh ├── es3.env ├── interp.sh ├── run.sh ├── src ├── LambdaJS.hs └── Language │ └── LambdaJS │ ├── AssignableVars.hs │ ├── Desugar.hs │ ├── DesugarWith.hs │ ├── ECMAEnvironment.hs │ ├── Lexer.hs │ ├── LiftFuncStmts.hs │ ├── LocalVars.hs │ ├── Parser.hs │ ├── Prelude.hs │ ├── PrettyPrint.hs │ ├── RemoveHOAS.hs │ └── Syntax.hs ├── unit-test-one.sh └── unit-test.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /*/dist 2 | .DS_Store 3 | /Redex/compiled 4 | *~ 5 | *.vo 6 | *.glob 7 | *.v.d 8 | coq/Makefile 9 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Spiridon Eliopoulos 2 | Arjun Guha 3 | Benjamin Lerner 4 | Joe Gibbs Politz 5 | Claudiu Saftoiu 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | LambdaJS 2 | Copyright (c) 2009--2012 Brown University and Claudiu Saftoiu. 3 | All Rights Reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of the Brown University, nor the names 15 | of its contributors may be used to endorse or promote products derived 16 | from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | -------------------------------------------------------------------------------- /Paper Examples/Function-prototype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/Paper Examples/Function-prototype.png -------------------------------------------------------------------------------- /Paper Examples/Safe Subset.txt: -------------------------------------------------------------------------------- 1 | # Added December 17, 2009 2 | $ ./LambdaJS-DisableXHR 3 | Safe Forms 4 | ========== 5 | x < y 6 | x <= y 7 | x > y 8 | x >= y 9 | x instanceof y 10 | x == y 11 | x != y 12 | x === y 13 | x !== y 14 | x && y 15 | x || y 16 | x * y 17 | x / y 18 | x % y 19 | x - y 20 | x << y 21 | x >> y 22 | x >>> y 23 | x & y 24 | x ^ y 25 | x | y 26 | x + y 27 | x = y 28 | x += y 29 | x -= y 30 | x *= y 31 | x /= y 32 | x %= y 33 | x <<= y 34 | x >>= y 35 | x >>>= y 36 | x &= y 37 | x ^= y 38 | x |= y 39 | !x 40 | ~x 41 | +x 42 | -x 43 | typeof x 44 | void x 45 | delete x 46 | ++x 47 | --x 48 | x++ 49 | x-- 50 | this 51 | obj.field = e 52 | obj[field] = e 53 | obj.x 54 | new obj(arg) 55 | e1 ? e2 : e3 56 | f(arg) 57 | new f(arg) 58 | { x: e1, y: e2 } 59 | function(x) { body } 60 | e1 ? e2 : e3 61 | { s1 ; s2 } 62 | if (e1) { s1 } 63 | if (e1) { s1 } else { s2 } 64 | switch (e1) { case foo: s1 65 | case bar: s2 } 66 | while (e1) { s1 } 67 | break lbl 68 | break 69 | continue lbl 70 | continue 71 | myLabel: s 72 | for (var x in e) { s } 73 | for (x in e) { s } 74 | for (var x = e1; e2; e3) { s } 75 | try { s1 } catch(x) { s2 } 76 | try { s1 } finally { s2 } 77 | throw e 78 | return e 79 | var x = e 80 | 81 | Unsafe Forms 82 | ============ 83 | obj.XMLHttpRequest 84 | obj[field] 85 | obj[field]++ 86 | obj[field]-- 87 | ++obj[field] 88 | --obj[field] 89 | 90 | lookup is defined as: 91 | function(obj, field) { 92 | if (field === "XMLHttpRequest") { 93 | return undefined; 94 | } 95 | else if (typeof field === "string") { 96 | return obj[field]; 97 | } 98 | else { 99 | return undefined; 100 | } } 101 | 102 | lookup is typable. 103 | 104 | -------------------------------------------------------------------------------- /Paper Examples/array-processing.js: -------------------------------------------------------------------------------- 1 | function sum(arr) { 2 | var r = 0; 3 | for (var i = 0; i < arr["length"]; i = i + 1) { 4 | r = r + arr[i]; }; 5 | return r }; 6 | 7 | print(sum([1, 2, 3])); 8 | var a = [1, 2, 3, 4]; 9 | delete a["3"]; 10 | print(sum(a)); 11 | -------------------------------------------------------------------------------- /Paper Examples/constructors.js: -------------------------------------------------------------------------------- 1 | function Point(x, y) { 2 | print(this.__proto__ === Point.prototype && x === 50 && y === 100); 3 | this.x = x; 4 | this.y = y }; 5 | 6 | pt = new Point(50, 100); 7 | 8 | Point.prototype.getX = function() { return this.x } 9 | print(pt.getX()); 10 | 11 | -------------------------------------------------------------------------------- /Paper Examples/dog-lab.js: -------------------------------------------------------------------------------- 1 | var animal = { "length": 13, "width": 7 }; 2 | var dog = { "__proto__": animal, "barks": true }; 3 | 4 | print(dog["length"]); 5 | print(dog["width"]); 6 | 7 | var lab = { "__proto__": dog, "length": 2 }; 8 | 9 | print(lab["length"]); 10 | print(lab["width"]); 11 | print(lab["barks"]); 12 | 13 | dog["width"] = 19; 14 | print(dog["width"]); 15 | print(animal["width"]); 16 | 17 | print(lab["width"]); 18 | -------------------------------------------------------------------------------- /Paper Examples/functions-as-objects.js: -------------------------------------------------------------------------------- 1 | f = function(x) { return x + 1 }; 2 | f.y = 90; 3 | print(f(f.y)) 4 | -------------------------------------------------------------------------------- /Paper Examples/functions-objects-state.ss: -------------------------------------------------------------------------------- 1 | #lang scheme 2 | 3 | (require "../Redex/jscore.ss") 4 | 5 | ;;; From Section 2.1 6 | 7 | (test 8 | (let ([obj (object ["x" 500] ["y" 100])]) 9 | (let ([select (lambda (name) (get-field obj name))]) 10 | (+ (select "x") (select "y")))) 11 | 600) 12 | 13 | (test 14 | (get-field (object ["x" 7]) "y") 15 | undefined) 16 | 17 | (test 18 | (update-field (object ["x" 0]) "x" 10) 19 | (object ["x" 10])) 20 | 21 | (test 22 | (update-field (object ["x" 0]) "z" 20) 23 | (object ["z" 20] ["x" 0])) 24 | 25 | (test 26 | (delete-field (object ["x" 7] ["y" 13]) "x") 27 | (object ["y" 13])) 28 | 29 | 30 | ;;; Subject Reduction example 31 | 32 | (trace 33 | (let ([window (alloc (object ["XMLHttpRequest" "DANGER"]))] 34 | [lookup (lambda (obj field) 35 | (if (=== field "XMLHttpRequest") 36 | undefined 37 | (get-field (deref obj) field)))]) 38 | (lookup window "XMLHttpRequest"))) 39 | -------------------------------------------------------------------------------- /Paper Examples/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Paper Examples/instanceof.js: -------------------------------------------------------------------------------- 1 | function Dog() { this.barks = "woof" }; 2 | function Cat() { this.purrs = "meow" }; 3 | dog = new Dog(); 4 | cat = new Cat(); 5 | print(dog.barks); // produces "woof" 6 | print(cat.purrs); // produces "meow" 7 | 8 | function animalThing(obj) { 9 | if (obj instanceof Cat) { return obj.purrs } 10 | else if (obj instanceof Dog) { return obj.barks } 11 | else { return "unknown animal" } }; 12 | 13 | print(animalThing(dog)); // returns "woof" 14 | print(animalThing(cat)); // returns "meow" 15 | print(animalThing(4234)); // returns "unknown animal" 16 | 17 | print(cat.__proto__ === Cat.prototype && 18 | dog.__proto__ === Dog.prototype && 19 | Cat.prototype !== Dog.prototype); 20 | 21 | 22 | Cat.prototype = Dog.prototype; 23 | 24 | print(cat.__proto__ !== Cat.prototype && 25 | dog.__proto__ === Dog.prototype && 26 | Cat.prototype === Dog.prototype); 27 | 28 | print(animalThing(cat)); // returns "unknown animal" 29 | print(animalThing(dog)) // returns undefined 30 | 31 | -------------------------------------------------------------------------------- /Paper Examples/js: -------------------------------------------------------------------------------- 1 | ../LambdaJS/Tests/impl.spidermonkey -------------------------------------------------------------------------------- /Paper Examples/locals.js: -------------------------------------------------------------------------------- 1 | function foo() { 2 | if (true) { var x = 10 }; 3 | return x}; 4 | 5 | print(foo()); // 10 6 | 7 | function bar() { 8 | x = 10; 9 | var x = x * x; 10 | return x } 11 | 12 | print(bar()); // 100 13 | x // error 14 | -------------------------------------------------------------------------------- /Paper Examples/primitives.js: -------------------------------------------------------------------------------- 1 | x = 10; 2 | y = new Number(7); 3 | 4 | print(typeof x); 5 | print(typeof y); 6 | 7 | print(x + y); 8 | 9 | Number.prototype.valueOf = function() { return 0 }; 10 | print(x + y); 11 | 12 | print(y.toString()); 13 | print(x + y.toString()); 14 | print(x * y.toString()); 15 | -------------------------------------------------------------------------------- /Paper Examples/this.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Paper Examples/unsafe-lookup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LambdaJS 2 | ======== 3 | 4 | LambdaJS is small, tested, reduction semantics for JavaScript. For a quick 5 | introduction, see our blog post: 6 | 7 | http://brownplt.github.com/2011/09/29/js-essence.html 8 | 9 | For a more technical introduction, see our ECOOP 2010 paper on LambdaJS: 10 | 11 | http://www.cs.brown.edu/~sk/Publications/Papers/Published/gsk-essence-javascript/ 12 | 13 | 14 | - coq/ contains our mechanized semantics in Coq. Tested with Coq 8.3 and 8.4 15 | beta. 16 | 17 | - Redex/ contains our mechanized semantics in PLT Redex. Tested with 18 | Racket 5.2. 19 | 20 | - haskell/ contains an implementation of desugaring. Tested with GHC 7.0.4. 21 | This software uses packages available on Hackage. 22 | 23 | - DisableXHR/ contains an implementation of our safe-subset example. Tested 24 | with GHC 6.10.4. This tool requires the LambdaJS Haskell package to be built 25 | and installed first. 26 | 27 | Semantics for ECMAScript 5 28 | ========================== 29 | 30 | LambdaJS roughly models ECMAScript 3. The latest version of JavaScript, ECMAScript 5, is considerably more complex, so we decided to develop it from scratch. 31 | The following blog post describes S5, our semantics for ES5: 32 | 33 | http://brownplt.github.com/2011/11/11/s5-javascript-semantics.html 34 | 35 | The code for S5 is also available: 36 | 37 | https://github.com/brownplt/LambdaS5 38 | -------------------------------------------------------------------------------- /Redex/interp-shell.ss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env mzscheme 2 | #lang scheme 3 | 4 | (require "interp.ss") 5 | 6 | ; Suppresses printing the result (which is invariably undefined) 7 | (void ((interp empty-env) (read))) -------------------------------------------------------------------------------- /Redex/redex-shell.ss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env mzscheme 2 | #lang scheme 3 | 4 | (require redex) 5 | (require "jscore.ss") 6 | 7 | (apply-reduction-relation* 8 | eval-lambdaJS-errors (term (() ,(read)))) 9 | -------------------------------------------------------------------------------- /Redex/test-shell.ss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env mzscheme 2 | #lang scheme 3 | 4 | (require "interp.ss") 5 | 6 | (define total 0) 7 | (define errors 0) 8 | (define failures 0) 9 | 10 | ; JavaScript's object graph has cycles (see desugaring of the .constructor 11 | ; fields). We either do a lot of work to test cycles correctly, or hack 12 | ; this test. 13 | (define (equal-0? v1 v2) 14 | (or (equal? v1 v2) 15 | (and (box? v1) (box? v2) 16 | (equal-0? (unbox v1) (unbox v2))) 17 | (and (procedure? v1) (procedure? v2)) 18 | (and (hash? v1) (hash? v2)))) 19 | 20 | ; Test if v1 and v2 are equal. Caveats: 21 | ; 22 | ; 1. Assumes that all procedures are equal. 23 | ; 2. Recurs into references, without checking for loops (very unlikely). 24 | ; 3. If v1 and v2 are objects, their fields are compared, but nested objects are 25 | ; assumed equal (using equal-0?). 26 | (define (equal-1? v1 v2) 27 | (or (equal? v1 v2) 28 | (and (box? v1) (box? v2) 29 | (equal-1? (unbox v1) (unbox v2))) 30 | (and (procedure? v1) (procedure? v2)) 31 | (and (hash? v1)(hash? v2) 32 | (for/last [(item (map cons (hash-map v1 cons) (hash-map v2 cons)))] 33 | (match item 34 | [`((,k1 . ,v1) . (,k2 . ,v2)) 35 | (and (equal? k1 k2) 36 | (equal-0? v1 v2))] 37 | [_ false]))))) 38 | 39 | (for ([test-case (read)]) 40 | (match test-case 41 | [`(,source ,lhs ,rhs) 42 | (with-handlers 43 | ([exn? (λ (exn) 44 | (set! errors (add1 errors)) 45 | (printf "FAILED ~a; signalled an exception:~n~a~n" source exn))]) 46 | (set! total (add1 total)) 47 | (let ([result ((interp empty-env) lhs)] 48 | [expected ((interp empty-env) rhs)]) 49 | (unless (equal-1? result expected) 50 | (set! failures (add1 failures)) 51 | (printf "FAILED ~a; got:~n~a~nExpected:~n~a~n" source result expected))))])) 52 | 53 | (printf "Testing Complete.~nTotal: ~a, Failures ~a, Exceptions: ~a~n" 54 | total failures errors) -------------------------------------------------------------------------------- /coq/Datatypes.v: -------------------------------------------------------------------------------- 1 | Require Import Coq.Structures.Orders. 2 | Require Import Coq.Structures.OrderedType. 3 | Require Import Coq.Strings.String. 4 | Require Import Coq.Logic.Decidable. 5 | Set Implicit Arguments. 6 | 7 | Module Type STRING. 8 | 9 | Parameter string : Set. 10 | Declare Module String_as_OT : UsualOrderedType with Definition t := string. 11 | Declare Module Ordered : Coq.Structures.OrderedType.OrderedType 12 | with Definition t := string. 13 | Module OrderedTypeFacts := Coq.Structures.OrderedType.OrderedTypeFacts (Ordered). 14 | Parameter string_eq_dec : forall s1 s2 : string, {s1 = s2} + {~ s1 = s2}. 15 | Parameter string_dec_eq : forall s1 s2 : string, s1 = s2 \/ ~ s1 = s2. 16 | 17 | End STRING. 18 | 19 | Module Type ATOM. 20 | 21 | Parameter atom : Set. 22 | Declare Module Atom_as_OT : UsualOrderedType with Definition t := atom. 23 | Declare Module Ordered : Coq.Structures.OrderedType.OrderedType 24 | with Definition t := atom. 25 | Module OrderedTypeFacts := Coq.Structures.OrderedType.OrderedTypeFacts (Ordered). 26 | Parameter atom_fresh_for_list : forall (xs : list atom), 27 | exists x : atom, ~ List.In x xs. 28 | Parameter atom_eq_dec : forall a1 a2 : atom, {a1 = a2} + {~ a1 = a2}. 29 | Parameter atom_dec_eq : forall a1 a2 : atom, a1 = a2 \/ ~ a1 = a2. 30 | 31 | End ATOM. 32 | -------------------------------------------------------------------------------- /coq/configure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | coq_makefile SfLib.v ListExt.v Datatypes.v LambdaJS_Defs.v LambdaJS_Tactics.v LambdaJS.v > Makefile 3 | -------------------------------------------------------------------------------- /haskell/LambdaJS.cabal: -------------------------------------------------------------------------------- 1 | Name: LambdaJS 2 | Version: 1.2 3 | Cabal-Version: >= 1.2.3 4 | Copyright: Copyright (c) 2009--2012 Brown University and Claudiu Saftoiu 5 | License: BSD3 6 | License-file: ../LICENSE 7 | Author: Arjun Guha, Claudiu Saftoiu 8 | Maintainer: Arjun Guha 9 | Homepage: http://www.cs.brown.edu/~arjun/ 10 | Stability: experimental 11 | Category: Language 12 | Build-Type: Custom 13 | Synopsis: Compiler from JavaScript to LambdaJS. 14 | Description: 15 | 16 | Library 17 | Hs-Source-Dirs: src 18 | Build-Depends: 19 | base >= 4 && < 5, 20 | mtl >= 1.1.0.1, 21 | parsec >= 3.0.0, 22 | pretty >= 0.1, 23 | containers >= 0.1, 24 | syb >= 0.1, 25 | language-ecmascript 26 | ghc-options: 27 | -fwarn-incomplete-patterns 28 | Extensions: 29 | DeriveDataTypeable Rank2Types FlexibleInstances 30 | Exposed-Modules: 31 | Language.LambdaJS.Desugar 32 | Language.LambdaJS.ECMAEnvironment 33 | Language.LambdaJS.DesugarWith 34 | Language.LambdaJS.LiftFuncStmts 35 | Language.LambdaJS.PrettyPrint 36 | Language.LambdaJS.LocalVars 37 | Language.LambdaJS.Syntax 38 | Language.LambdaJS.RemoveHOAS 39 | Language.LambdaJS.AssignableVars 40 | Other-Modules: 41 | Language.LambdaJS.Prelude 42 | 43 | Executable lambdaJS 44 | Main-Is: LambdaJS.hs 45 | Hs-Source-Dirs: src 46 | Build-Depends: 47 | base >= 4 && < 5, 48 | mtl >= 1.1.0.1, 49 | parsec >= 3.0.0, 50 | pretty >= 0.1, 51 | containers >= 0.1, 52 | syb >= 0.1, 53 | language-ecmascript 54 | ghc-options: 55 | -fwarn-incomplete-patterns -rtsopts 56 | Extensions: 57 | DeriveDataTypeable Rank2Types FlexibleInstances 58 | -------------------------------------------------------------------------------- /haskell/Setup.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env runhaskell 2 | import Distribution.Simple 3 | import qualified Data.List as L 4 | import System.Directory 5 | import qualified Data.Char as Ch 6 | import System.Process (runCommand,waitForProcess) 7 | 8 | isHaskellFile file = ".lhs" `L.isSuffixOf` file || ".hs" `L.isSuffixOf` file 9 | 10 | moduleName file = L.takeWhile (/= '.') file 11 | 12 | isRequested :: [String] -> String -> Bool 13 | isRequested requestedTests test = 14 | (map Ch.toLower test) `elem` (map (map Ch.toLower) requestedTests) 15 | 16 | testMain args _ _ _ = do 17 | files <- getDirectoryContents "tests" 18 | let testFiles = filter isHaskellFile files 19 | let testModules = if null args 20 | then map moduleName testFiles 21 | else filter (isRequested args) (map moduleName testFiles) 22 | let testFuncs = map (++ ".main") testModules 23 | let testExpr = "sequence [ " ++ concat (L.intersperse "," testFuncs) ++ 24 | " ] >>= \\cases -> runTestTT (TestList cases)" 25 | let moduleLine = concat (L.intersperse " " testModules) 26 | let cmd = "cd tests && ghc -XNoMonomorphismRestriction -fglasgow-exts " ++ 27 | "-package HUnit -package parsec-2.1.0.1 -i:../src -e \"" ++ 28 | testExpr ++ " >> return ()\" " ++ moduleLine 29 | putStrLn "Testing command is:" 30 | putStrLn cmd 31 | putStrLn "\nLoading tests..." 32 | handle <- runCommand cmd 33 | waitForProcess handle 34 | putStrLn "Testing complete. Errors reported above (if any)." 35 | 36 | 37 | main = defaultMainWithHooks (simpleUserHooks { runTests = testMain }) 38 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Array/regress-322135-02.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Joaquin Cuenca Abela 23 | * Martin Honnen 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | var gTestfile = 'regress-322135-02.js'; 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 322135; 42 | var summary = 'Array.prototype.concat on Array with length 2^32-1'; 43 | var actual = 'Completed'; 44 | var expect = 'Completed'; 45 | 46 | printBugNumber(BUGNUMBER); 47 | printStatus (summary); 48 | 49 | printStatus('This bug passes if it does not cause an out of memory error'); 50 | printStatus('Other issues related to array length are not tested.'); 51 | 52 | var length = 4294967295; 53 | var array1 = new Array(length); 54 | var array2 = ['Kibo']; 55 | var array; 56 | 57 | try 58 | { 59 | array = array1.concat(array2); 60 | } 61 | catch(ex) 62 | { 63 | printStatus(ex.name + ': ' + ex.message); 64 | } 65 | reportCompare(expect, actual, summary); 66 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/FunExpr/fe-001-n.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'fe-001-n.js'; 42 | 43 | DESCRIPTION = "Previous statement should have thrown a ReferenceError"; 44 | EXPECTED = "error"; 45 | 46 | test(); 47 | 48 | function test() 49 | { 50 | enterFunc ("test"); 51 | printStatus ("Function Expression test."); 52 | 53 | var x = function f(){return "inner";}(); 54 | var y = f(); 55 | reportCompare('PASS', 'FAIL', "Previous statement should have thrown a ReferenceError"); 56 | 57 | exitFunc ("test"); 58 | } 59 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Function/call-001.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/haskell/Tests/RemovedTests/Permanent/Function/call-001.js -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Function/regress-58274.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/haskell/Tests/RemovedTests/Permanent/Function/regress-58274.js -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Number/15.7.4.3-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Jeff Walden. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.7.4.3-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = "412068"; 41 | var summary = "num.toLocaleString incorrectly accesses its first argument " + 42 | "even when no first argument has been given"; 43 | var actual, expect; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus(summary); 47 | 48 | /************** 49 | * BEGIN TEST * 50 | **************/ 51 | 52 | var failed = false; 53 | 54 | try 55 | { 56 | if ("3" !== 3..toLocaleString()) 57 | throw '"3" should equal 3..toLocaleString()'; 58 | if ("9" !== 9..toLocaleString(8)) 59 | throw 'Number.prototype.toLocaleString should ignore its first argument'; 60 | } 61 | catch (e) 62 | { 63 | failed = e; 64 | } 65 | 66 | expect = false; 67 | actual = failed; 68 | 69 | reportCompare(expect, actual, summary); 70 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Number/15.7.4.7-2.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Jeff Walden. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.7.4.7-2.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = "411893"; 41 | var summary = "num.toPrecision(undefined) should equal num.toString()"; 42 | var actual, expect; 43 | 44 | printBugNumber(BUGNUMBER); 45 | printStatus(summary); 46 | 47 | /************** 48 | * BEGIN TEST * 49 | **************/ 50 | 51 | var failed = false; 52 | 53 | try 54 | { 55 | var prec = 3.3.toPrecision(undefined); 56 | var str = 3.3.toString(); 57 | if (prec !== str) 58 | { 59 | throw "not equal! " + 60 | "3.3.toPrecision(undefined) === '" + prec + "', " + 61 | "3.3.toString() === '" + str + "'"; 62 | } 63 | } 64 | catch (e) 65 | { 66 | failed = e; 67 | } 68 | 69 | expect = false; 70 | actual = failed; 71 | 72 | reportCompare(expect, actual, summary); 73 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Number/regress-442242-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Igor Bukanov 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-442242-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 442242; 41 | var summary = 'Do not assert: INT_FITS_IN_JSVAL(i)'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | var i = 28800000; 57 | -i; 58 | 59 | reportCompare(expect, actual, summary); 60 | 61 | exitFunc ('test'); 62 | } 63 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Object/regress-385393-07.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-385393-07.js'; 39 | 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 385393; 42 | var summary = 'Regression test for bug 385393'; 43 | var actual = 'No Crash'; 44 | var expect = 'No Crash'; 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | try 57 | { 58 | (2).eval(); 59 | } 60 | catch(ex) 61 | { 62 | } 63 | 64 | reportCompare(expect, actual, summary); 65 | 66 | exitFunc ('test'); 67 | } 68 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/15.10.2.12.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Igor Tandetnik 23 | * Martin Honnen 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | var gTestfile = '15.10.2.12.js'; 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 378738; 42 | var summary = '15.10.2.12 - CharacterClassEscape \d'; 43 | var actual = ''; 44 | var expect = ''; 45 | 46 | 47 | //----------------------------------------------------------------------------- 48 | test(); 49 | //----------------------------------------------------------------------------- 50 | 51 | function test() 52 | { 53 | enterFunc ('test'); 54 | printBugNumber(BUGNUMBER); 55 | printStatus (summary); 56 | 57 | expect = false; 58 | actual = /\d/.test("\uFF11"); 59 | 60 | reportCompare(expect, actual, summary); 61 | 62 | exitFunc ('test'); 63 | } 64 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/RegExp/ 2 | script 15.10.2-1.js 3 | script 15.10.2.12.js 4 | script 15.10.3.1-1.js 5 | script 15.10.3.1-2.js 6 | script 15.10.4.1-1.js 7 | script 15.10.4.1-2.js 8 | script 15.10.4.1-3.js 9 | script 15.10.4.1-4.js 10 | script 15.10.4.1-5-n.js 11 | script 15.10.4.1-6.js 12 | script 15.10.6.2-1.js 13 | script 15.10.6.2-2.js 14 | script octal-001.js 15 | script octal-002.js 16 | script perlstress-001.js 17 | script perlstress-002.js 18 | script regress-100199.js 19 | script regress-105972.js 20 | script regress-119909.js 21 | script regress-122076.js 22 | script regress-123437.js 23 | script regress-165353.js 24 | script regress-169497.js 25 | script regress-169534.js 26 | script regress-187133.js 27 | script regress-188206.js 28 | script regress-191479.js 29 | script regress-202564.js 30 | script regress-209067.js 31 | script regress-209919.js 32 | script regress-216591.js 33 | script regress-220367-001.js 34 | script regress-223273.js 35 | script regress-223535.js 36 | script regress-224676.js 37 | script regress-225289.js 38 | script regress-225343.js 39 | script regress-24712.js 40 | script regress-285219.js 41 | script regress-28686.js 42 | random script regress-289669.js # BigO 43 | skip script regress-307456.js # slow 44 | script regress-309840.js 45 | random script regress-311414.js # BigO 46 | script regress-312351.js 47 | script regress-31316.js 48 | skip script regress-330684.js # slow 49 | script regress-334158.js 50 | script regress-346090.js 51 | script regress-367888.js 52 | script regress-375642.js 53 | script regress-375711.js 54 | script regress-375715-01-n.js 55 | script regress-375715-02.js 56 | script regress-375715-03.js 57 | script regress-375715-04.js 58 | script regress-436700.js 59 | script regress-465862.js 60 | script regress-57572.js 61 | script regress-57631.js 62 | script regress-67773.js 63 | script regress-72964.js 64 | script regress-76683.js 65 | script regress-78156.js 66 | script regress-85721.js 67 | script regress-87231.js 68 | script regress-98306.js 69 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-24712.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'regress-24712.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printBugNumber (24712); 50 | 51 | var re = /([\S]+([ \t]+[\S]+)*)[ \t]*=[ \t]*[\S]+/; 52 | var result = re.exec("Course_Creator = Test") + ''; 53 | 54 | reportCompare('Course_Creator = Test,Course_Creator,', result, 'exec() returned null'); 55 | 56 | exitFunc ("test"); 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-285219.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Brendan Eich 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-285219.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 285219; 41 | var summary = 'Do not crash on RangeError: reserved slot out of range'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | var o = {hi: 'there'}; 49 | eval("var r = /re(1)(2)(3)/g", o); 50 | 51 | reportCompare(expect, actual, summary); 52 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-28686.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'regress-28686.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printBugNumber (28686); 50 | 51 | var str = 'foo "bar" baz'; 52 | reportCompare ('foo \\"bar\\" baz', str.replace(/([\'\"])/g, "\\$1"), 53 | "str.replace failed."); 54 | 55 | exitFunc ("test"); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-309840.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Phil Schwartau 23 | * Bob Clary 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | var gTestfile = 'regress-309840.js'; 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 309840; 42 | var summary = 'Treat / in a literal regexp class as valid'; 43 | var actual = 'No error'; 44 | var expect = 'No error'; 45 | 46 | printBugNumber(BUGNUMBER); 47 | printStatus (summary); 48 | 49 | try 50 | { 51 | var re = eval('/[/]/'); 52 | } 53 | catch(e) 54 | { 55 | actual = e.toString(); 56 | } 57 | 58 | reportCompare(expect, actual, summary); 59 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-312351.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): drimbk@yahoo.com 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-312351.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 312351; 41 | var summary = 'Do not crash on RegExp(null)'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | var x = RegExp(null); 49 | 50 | reportCompare(expect, actual, summary); 51 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-330684.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2006 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Shaohua Wen 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-330684.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 330684; 41 | var summary = 'Do not hang on RegExp'; 42 | var actual = 'Do not hang on RegExp'; 43 | var expect = ''; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | var re = /^(?:(?:%[0-9A-Fa-f]{2})*[!\$&'\*-;=\?-Z_a-z]*)+$/; 49 | var url = "http://tw.yimg.com/a/tw/wenchuan/cam_240x400_381615_030806_2.swf?clickTAG=javascript:VRECopenWindow(1)"; 50 | 51 | printStatus(re.test(url)); 52 | 53 | reportCompare(expect, actual, summary); 54 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-334158.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2006 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Andreas 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-334158.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 334158; 41 | var summary = 'Parse error in control letter escapes (RegExp)'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | expect = true; 49 | actual = /\ca/.test( "\x01" ); 50 | reportCompare(expect, actual, summary + ':/\ca/.test( "\x01" )'); 51 | 52 | expect = false 53 | actual = /\ca/.test( "\\ca" ); 54 | reportCompare(expect, actual, summary + ': /\ca/.test( "\\ca" )'); 55 | 56 | expect = false 57 | actual = /\c[a/]/.test( "\x1ba/]" ); 58 | reportCompare(expect, actual, summary + ': /\c[a/]/.test( "\x1ba/]" )'); 59 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-346090.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2006 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Priit Laes 23 | * Brian Crowder 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | var gTestfile = 'regress-346090.js'; 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 346090; 42 | var summary = 'Do not crash with this regexp'; 43 | var actual = 'No Crash'; 44 | var expect = 'No Crash'; 45 | 46 | 47 | //----------------------------------------------------------------------------- 48 | test(); 49 | //----------------------------------------------------------------------------- 50 | 51 | function test() 52 | { 53 | enterFunc ('test'); 54 | printBugNumber(BUGNUMBER); 55 | printStatus (summary); 56 | 57 | var r = /%((h[^l]+)|(l[^h]+)){0,2}?a/g; 58 | r.exec('%lld %d'); 59 | 60 | reportCompare(expect, actual, summary); 61 | 62 | exitFunc ('test'); 63 | } 64 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-367888.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-367888.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 367888; 41 | var summary = 'RegExp /(|)??x/g.exec("y") barfs'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | expect = null; 57 | actual = /(|)??x/g.exec("y"); 58 | 59 | reportCompare(expect, actual, summary); 60 | 61 | exitFunc ('test'); 62 | } 63 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-375642.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-375642.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 375642; 41 | var summary = 'RegExp /(?:a??)+?/.exec("")'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | /(?:a??)+?/.exec("") 57 | 58 | reportCompare(expect, actual, summary); 59 | 60 | exitFunc ('test'); 61 | } 62 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-375715-01-n.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-375715-01-n.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 375715; 41 | var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | //----------------------------------------------------------------------------- 46 | test(); 47 | //----------------------------------------------------------------------------- 48 | 49 | function test() 50 | { 51 | enterFunc ('test'); 52 | printBugNumber(BUGNUMBER); 53 | printStatus (summary); 54 | 55 | // note that the assertion does not fire if the regexp is 56 | // evald or used in new RegExp, so this test must be an -n 57 | // with uncaught SyntaxError. 58 | 59 | /[\Wb-G]/.exec(""); 60 | reportCompare(expect, actual, summary + ' /[\Wb-G]/.exec("")'); 61 | 62 | exitFunc ('test'); 63 | } 64 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-375715-02.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-375715-02.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 375715; 41 | var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | /[\s-:]/; 57 | reportCompare(expect, actual, summary + '/[\s-:]/'); 58 | 59 | exitFunc ('test'); 60 | } 61 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-375715-03.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-375715-03.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 375715; 41 | var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | /[_-t]/i.exec(""); 57 | reportCompare(expect, actual, summary + '/[_-t]/i.exec("")'); 58 | 59 | exitFunc ('test'); 60 | } 61 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-375715-04.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-375715-04.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 375715; 41 | var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | try 57 | { 58 | expect = 'SyntaxError: invalid range in character class'; 59 | (new RegExp("[\xDF-\xC7]]", "i")).exec(""); 60 | } 61 | catch(ex) 62 | { 63 | actual = ex + ''; 64 | } 65 | reportCompare(expect, actual, summary + '(new RegExp("[\xDF-\xC7]]", "i")).exec("")'); 66 | 67 | exitFunc ('test'); 68 | } 69 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/RegExp/regress-436700.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Sylvain Pasche 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-436700.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 436700; 41 | var summary = 'Do not assert: 1 <= num && num <= 0x10000'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | try 57 | { 58 | /\2147483648/.exec(String.fromCharCode(140) + "7483648").toString(); 59 | } 60 | catch(ex) 61 | { 62 | } 63 | 64 | reportCompare(expect, actual, summary); 65 | 66 | exitFunc ('test'); 67 | } 68 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Regress/regress-385393-04.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-385393-04.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 385393; 41 | var summary = 'Regression test for bug 385393'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | //----------------------------------------------------------------------------- 46 | test(); 47 | //----------------------------------------------------------------------------- 48 | 49 | function test() 50 | { 51 | enterFunc ('test'); 52 | printBugNumber(BUGNUMBER); 53 | printStatus (summary); 54 | 55 | try 56 | { 57 | 'a'.replace(/a/g, eval); 58 | } 59 | catch(ex) 60 | { 61 | } 62 | 63 | reportCompare(expect, actual, summary); 64 | 65 | exitFunc ('test'); 66 | } 67 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Regress/regress-420610.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-420610.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 420610; 41 | var summary = 'Do not crash with eval("this.x")'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | (function(){ eval("this.x") })(); 49 | 50 | reportCompare(expect, actual, summary); 51 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Statements/regress-302439.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/haskell/Tests/RemovedTests/Permanent/Statements/regress-302439.js -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Statements/regress-444979.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/haskell/Tests/RemovedTests/Permanent/Statements/regress-444979.js -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/String/15.5.4.14.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Karsten Sperling 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.5.4.14.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 287630; 41 | var summary = '15.5.4.14 - String.prototype.split(/()/)'; 42 | var actual = ''; 43 | var expect = ['a'].toString(); 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | actual = 'a'.split(/()/).toString(); 49 | 50 | reportCompare(expect, actual, summary); 51 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/String/regress-304376.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Blake Kaplan 23 | * timeless 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | var gTestfile = 'regress-304376.js'; 40 | //----------------------------------------------------------------------------- 41 | var BUGNUMBER = 304376; 42 | var summary = 'String.prototype should be readonly and permanent'; 43 | var actual = ''; 44 | var expect = ''; 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | expect = 'TypeError'; 49 | 50 | var saveString = String; 51 | 52 | String = Array; 53 | 54 | try 55 | { 56 | // see if we can crash... 57 | "".join(); 58 | String = saveString; 59 | actual = 'No Error'; 60 | } 61 | catch(ex) 62 | { 63 | String = saveString; 64 | actual = ex.name; 65 | printStatus(ex + ''); 66 | } 67 | 68 | reportCompare(expect, actual, summary); 69 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Unicode/ 2 | script regress-352044-01.js 3 | script regress-352044-02-n.js 4 | script uc-001-n.js 5 | skip script uc-001.js # obsolete test 6 | script uc-002-n.js 7 | script uc-002.js 8 | script uc-003.js 9 | script uc-004.js 10 | script uc-005.js 11 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/regress-352044-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Martin Honnen 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-352044-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 352044; 41 | var summary = 'issues with Unicode escape sequences in JavaScript source code'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | expect = 'SyntaxError: illegal character'; 57 | 58 | try 59 | { 60 | var i = 1; 61 | eval('i \\u002b= 1'); 62 | print(i); 63 | } 64 | catch(ex) 65 | { 66 | actual = ex + ''; 67 | } 68 | 69 | reportCompare(expect, actual, summary); 70 | 71 | exitFunc ('test'); 72 | } 73 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/regress-352044-02-n.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Martin Honnen 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-352044-02-n.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 352044; 41 | var summary = 'issues with Unicode escape sequences in JavaScript source code'; 42 | var actual = 'No Error'; 43 | var expect = 'SyntaxError'; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | print('This test case is expected to throw an uncaught SyntaxError'); 57 | 58 | try 59 | { 60 | var i = 1; 61 | i \u002b= 1; 62 | print(i); 63 | } 64 | catch(ex) 65 | { 66 | actual = ex + ''; 67 | } 68 | 69 | reportCompare(expect, actual, summary); 70 | 71 | exitFunc ('test'); 72 | } 73 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Unicode'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-001-n.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-001-n.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printStatus ("Unicode Characters 1C-1F negative test."); 50 | printBugNumber (23612); 51 | 52 | reportCompare ("error", eval ("'no'\u001C+' error'"), 53 | "Unicode whitespace test (1C.)"); 54 | reportCompare ("error", eval ("'no'\u001D+' error'"), 55 | "Unicode whitespace test (1D.)"); 56 | reportCompare ("error", eval ("'no'\u001E+' error'"), 57 | "Unicode whitespace test (1E.)"); 58 | reportCompare ("error", eval ("'no'\u001F+' error'"), 59 | "Unicode whitespace test (1F.)"); 60 | 61 | exitFunc ("test"); 62 | } 63 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-001.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-001.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printStatus ("Unicode format-control character (Category Cf) test."); 50 | printBugNumber (23610); 51 | 52 | reportCompare ("no error", eval('"no\u200E error"'), 53 | "Unicode format-control character test (Category Cf.)"); 54 | 55 | exitFunc ("test"); 56 | } 57 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-002-n.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-002-n.js'; 42 | 43 | DESCRIPTION = "Non-character escapes in identifiers negative test."; 44 | EXPECTED = "error"; 45 | 46 | enterFunc ("test"); 47 | 48 | printStatus ("Non-character escapes in identifiers negative test."); 49 | printBugNumber (23607); 50 | 51 | eval("\u0020 = 5"); 52 | reportCompare('PASS', 'FAIL', "Previous statement should have thrown an error."); 53 | 54 | exitFunc ("test"); 55 | 56 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-002.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-002.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printStatus ("Unicode non-breaking space character test."); 50 | printBugNumber (23613); 51 | 52 | reportCompare ("no error", eval("'no'\u00A0+ ' error'"), 53 | "Unicode non-breaking space character test."); 54 | 55 | var str = "\u00A0foo"; 56 | reportCompare (0, str.search(/^\sfoo$/), 57 | "Unicode non-breaking space character regexp test."); 58 | 59 | exitFunc ("test"); 60 | } 61 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-003.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-003.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | var \u0041 = 5; 50 | var A\u03B2 = 15; 51 | var c\u0061se = 25; 52 | 53 | printStatus ("Escapes in identifiers test."); 54 | printBugNumber (23608); 55 | printBugNumber (23607); 56 | 57 | reportCompare (5, eval("\u0041"), 58 | "Escaped ASCII Identifier test."); 59 | reportCompare (6, eval("++\u0041"), 60 | "Escaped ASCII Identifier test"); 61 | reportCompare (15, eval("A\u03B2"), 62 | "Escaped non-ASCII Identifier test"); 63 | reportCompare (16, eval("++A\u03B2"), 64 | "Escaped non-ASCII Identifier test"); 65 | reportCompare (25, eval("c\\u00" + "61se"), 66 | "Escaped keyword Identifier test"); 67 | reportCompare (26, eval("++c\\u00" + "61se"), 68 | "Escaped keyword Identifier test"); 69 | 70 | exitFunc ("test"); 71 | } 72 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-004.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'uc-004.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | enterFunc ("test"); 48 | 49 | printStatus ("Unicode Characters 1C-1F with regexps test."); 50 | printBugNumber (23612); 51 | 52 | var ary = ["\u001Cfoo", "\u001Dfoo", "\u001Efoo", "\u001Ffoo"]; 53 | 54 | for (var i in ary) 55 | { 56 | reportCompare (0, ary[Number(i)].search(/^\Sfoo$/), 57 | "Unicode characters 1C-1F in regexps, ary[" + 58 | i + "] did not match \\S test (it should not.)"); 59 | reportCompare (-1, ary[Number(i)].search(/^\sfoo$/), 60 | "Unicode characters 1C-1F in regexps, ary[" + 61 | i + "] matched \\s test (it should not.)"); 62 | } 63 | 64 | exitFunc ("test"); 65 | } 66 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Permanent/Unicode/uc-005.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brownplt/LambdaJS/d254442be3e2908191ef21b6d7560d66d30868d5/haskell/Tests/RemovedTests/Permanent/Unicode/uc-005.js -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/README.txt: -------------------------------------------------------------------------------- 1 | PERMANENTLY REMOVED: 2 | ---------------------- 3 | Spidermonkey/ 4 | Arrays/ 5 | regress-130451.js - uses eval 6 | ExecutionContexts/ 7 | Expressions/ 8 | 11.6.1-1.js - uses eval 9 | 11.9.6-1.js - uses eval to check that its return val is 'undefined' 10 | Function/ 11 | call-001 - eval 12 | Operators/ 13 | 11.13.1-001.js - uses eval 14 | order-01.js - more eval plox. can potentially be worked out, as it's 15 | a very simple use of it. 16 | Statements/ 17 | regress-157509.js - eval 18 | regress-194364.js - eval 19 | regress-302439.js - program too complex for Rhino 20 | not this is not a contrived example and maybe 21 | we shuld run it 22 | regress-324650.js - program too complex for Rhino 23 | regress-444979.js - too complx for Rhino 24 | regress-74474-002.js - too complex for Rhino 25 | regress-74474-003.js - cmplx for Rhino 26 | regress-83532-002.js - evalbomb 27 | regress-121744.js - has warning not to run it after 2002 28 | 29 | TEMPORARILY REMOVED: 30 | ----------------------- 31 | ExecutionContexts: 32 | 10.3.1-1.js - TMP: relies on arguments[0] being aliased to the formal var 33 | 34 | Exceptions 35 | - *pending DontDelete, ReadOnly, DontEnum 36 | - *binding-001.js: throw a ReferenceError for undeclared global variables. 37 | - *regress-181654: String.prototype.search 38 | - *regress-95101: String.prototype.search 39 | FunExpr 40 | - *fe-001.js: lifting order | Details of Rhino / SpiderMonkey 41 | 42 | Function 43 | - *15.3.4.3-1.js: dereffing arguments twice | apply details 44 | - *15.3.4.4-1.js: toObject received undefined | call not implemented 45 | - *regress-313570: something about prototype chains | ReadOnly 46 | - *regress-85880: something about arguments 47 | - *scope-001/002: opIN. maybe remove? 48 | Number 49 | - *15.7.4.5-2: toFixed fail. boring! 50 | 51 | Regress 52 | - *regress-419152: fix up array to have "" instead of "undefined" 53 | 54 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Date/15.9.1.2-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.9.1.2-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 264727; 41 | var summary = '15.9.1.2 - TimeWithinDay(TIME_1900) == 0'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | expect = 0; 57 | actual = TimeWithinDay(TIME_1900); 58 | 59 | reportCompare(expect, actual, summary); 60 | 61 | exitFunc ('test'); 62 | } 63 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Date/15.9.3.2-1.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | * Any copyright is dedicated to the Public Domain. 4 | * http://creativecommons.org/licenses/publicdomain/ 5 | * Contributor: Bob Clary 6 | */ 7 | 8 | var gTestfile = '15.9.3.2-1.js'; 9 | //----------------------------------------------------------------------------- 10 | var BUGNUMBER = 273292; 11 | var summary = '15.9.3.2 new Date(value)'; 12 | var actual = ''; 13 | var expect = ''; 14 | var date1; 15 | var date2; 16 | var i; 17 | var validDateStrings = [ 18 | "11/69/2004", 19 | "11/70/2004", 20 | "69/69/2004", 21 | "69/69/69", 22 | "69/69/1969", 23 | "70/69/70", 24 | "70/69/1970", 25 | "70/69/2004" 26 | ]; 27 | 28 | var invalidDateStrings = [ 29 | "70/70/70", 30 | "70/70/1970", 31 | "70/70/2004" 32 | ]; 33 | 34 | printBugNumber(BUGNUMBER); 35 | printStatus (summary); 36 | 37 | expect = 0; 38 | 39 | for (i = 0; i < validDateStrings.length; i++) 40 | { 41 | date1 = new Date(validDateStrings[i]); 42 | date2 = new Date(date1.toDateString()); 43 | actual = date2 - date1; 44 | 45 | reportCompare(expect, actual, inSection(i) + ' ' + 46 | validDateStrings[i]); 47 | } 48 | 49 | expect = true; 50 | 51 | var offset = validDateStrings.length; 52 | 53 | for (i = 0; i < invalidDateStrings.length; i++) 54 | { 55 | date1 = new Date(invalidDateStrings[i]); 56 | actual = isNaN(date1); 57 | 58 | reportCompare(expect, actual, inSection(i + offset) + ' ' + 59 | invalidDateStrings[i] + ' is invalid.'); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Date/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Date/ 2 | script 15.9.1.2-01.js 3 | script 15.9.3.2-1.js 4 | script 15.9.4.3.js 5 | script 15.9.5.3.js 6 | script 15.9.5.4.js 7 | script 15.9.5.5-02.js 8 | script 15.9.5.5.js # bug 332722 - Linux fails during DST 9 | script 15.9.5.6.js 10 | script 15.9.5.7.js 11 | script regress-452786.js 12 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Date/regress-452786.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Joachim Kuebart 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-452786.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 452786; 41 | var summary = 'Do not crash with (new Date()).getMonth.call(new Function())'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | try 57 | { 58 | (new Date()).getMonth.call(new Function()); 59 | } 60 | catch(ex) 61 | { 62 | } 63 | reportCompare(expect, actual, summary); 64 | 65 | exitFunc ('test'); 66 | } 67 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/FunExpr/fe-001.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'fe-001.js'; 42 | 43 | if (1) function f() {return 1;} 44 | if (0) function f() {return 0;} 45 | 46 | function test() 47 | { 48 | enterFunc ("test"); 49 | 50 | printStatus ("Function Expression Statements basic test."); 51 | 52 | reportCompare (1, f(), "Both functions were defined."); 53 | 54 | exitFunc ("test"); 55 | } 56 | 57 | test(); 58 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Function/regress-313570.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Yuh-Ruey Chen 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-313570.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 313570; 41 | var summary = 'length of objects whose prototype chain includes a function'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | function tmp() {} 49 | tmp.prototype = function(a, b, c) {}; 50 | var obj = new tmp(); 51 | 52 | // arity 53 | expect = 3; 54 | actual = obj.length; 55 | reportCompare(expect, actual, summary + ': arity'); 56 | 57 | // immutable 58 | obj.length = 10; 59 | 60 | expect = 3; 61 | actual = obj.length; 62 | reportCompare(expect, actual, summary + ': immutable'); 63 | 64 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/LexicalConventions/7.8.3-01.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Any copyright is dedicated to the Public Domain. 3 | * http://creativecommons.org/licenses/publicdomain/ 4 | */ 5 | 6 | var gTestfile = '7.8.3-01.js'; 7 | var BUGNUMBER = 523401; 8 | var summary = 'identifier starts immediately after numeric literal'; 9 | var expect = "SyntaxError: identifier starts immediately after numeric literal"; 10 | var actual; 11 | 12 | printBugNumber(BUGNUMBER); 13 | printStatus(summary); 14 | 15 | try { 16 | eval("actual = 0in [1]"); 17 | } catch (e) { 18 | actual = e; 19 | } 20 | actual = '' + actual; 21 | 22 | reportCompare(expect, actual, summary); 23 | 24 | printStatus("All tests passed!"); 25 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/LexicalConventions/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/LexicalConventions/ 2 | script 7.4-01.js 3 | script 7.8.3-01.js 4 | script 7.9.1.js 5 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/LexicalConventions/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'LexicalConventions'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/Number/15.7.4.5-2.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Adam L. Peller 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.7.4.5-2.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 469397; 41 | var summary = '(0.5).toFixed(0) == 1'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | expect = '1'; 57 | actual = (0.5).toFixed(0); 58 | 59 | reportCompare(expect, actual, summary); 60 | 61 | exitFunc ('test'); 62 | } 63 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/NumberFormatting/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/NumberFormatting/ 2 | script tostring-001.js 3 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/NumberFormatting/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'NumberFormatting'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/RemovedTests/Temporary/NumberFormatting/tostring-001.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'tostring-001.js'; 42 | 43 | test(); 44 | 45 | function test() 46 | { 47 | var n0 = 1e23; 48 | var n1 = 5e22; 49 | var n2 = 1.6e24; 50 | 51 | printStatus ("Number formatting test."); 52 | printBugNumber ("11178"); 53 | 54 | reportCompare ("1e+23", n0.toString(), "1e23 toString()"); 55 | reportCompare ("5e+22", n1.toString(), "5e22 toString()"); 56 | reportCompare ("1.6e+24", n2.toString(), "1.6e24 toString()"); 57 | 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Array/15.4.4.11-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Igor Bukanov 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.4.4.11-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 312138; 41 | var summary = 'Array.sort should not eat exceptions'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | expect = "e=1 N=1"; 49 | 50 | var N = 0; 51 | var array = [4,3,2,1]; 52 | 53 | try { 54 | array.sort(function() { 55 | throw ++N; 56 | }); 57 | } catch (e) { 58 | actual = ("e="+e+" N="+N); 59 | } 60 | 61 | reportCompare(expect, actual, summary); 62 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Array/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Array/ 2 | script 15.4.4.11-01.js 3 | script 15.4.4.3-1.js 4 | script 15.4.4.4-001.js 5 | script 15.4.5.1-01.js 6 | script 15.5.4.8-01.js 7 | script regress-101488.js 8 | script regress-130451.js 9 | script regress-322135-01.js 10 | script regress-322135-02.js 11 | skip script regress-322135-03.js # slow 12 | skip script regress-322135-04.js # slow 13 | script regress-387501.js 14 | script regress-421325.js 15 | script regress-430717.js 16 | script regress-488989.js 17 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Array/regress-421325.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Brian Crowder 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-421325.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 421325; 41 | var summary = 'Dense Arrays and holes'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | Array.prototype[1] = 'bar'; 57 | 58 | var a = []; 59 | a[0]='foo'; 60 | a[2] = 'baz'; 61 | expect = 'foo,bar,baz'; 62 | actual = a + ''; 63 | 64 | reportCompare(expect, actual, summary); 65 | 66 | exitFunc ('test'); 67 | } 68 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Array/regress-430717.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Mike Shaver 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-430717.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 430717; 41 | var summary = 'Dense Arrays should inherit deleted elements from Array.prototype'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | Array.prototype[2] = "two"; 57 | var a = [0,1,2,3]; 58 | delete a[2]; 59 | 60 | expect = 'two'; 61 | actual = a[2]; 62 | reportCompare(expect, actual, summary); 63 | 64 | exitFunc ('test'); 65 | } 66 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Array/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Array'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Exceptions/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Exceptions/ 2 | script 15.11.1.1.js 3 | script 15.11.4.4-1.js 4 | script 15.11.7.6-001.js 5 | script 15.11.7.6-002.js 6 | script 15.11.7.6-003.js 7 | script binding-001.js 8 | script regress-181654.js 9 | script regress-181914.js 10 | script regress-58946.js 11 | script regress-95101.js 12 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Exceptions/regress-58946.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is mozilla.org code. 17 | * 18 | * The Initial Developer of the Original Code is 19 | * Netscape Communications Corporation. 20 | * Portions created by the Initial Developer are Copyright (C) 1998 21 | * the Initial Developer. All Rights Reserved. 22 | * 23 | * Contributor(s): 24 | * pschwartau@netscape.com 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either the GNU General Public License Version 2 or later (the "GPL"), or 28 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | var gTestfile = 'regress-58946.js'; 41 | //------------------------------------------------------------------------------------------------- 42 | var BUGNUMBER = '58946'; 43 | var stat = 'Testing a return statement inside a catch statement inside a function'; 44 | 45 | test(); 46 | 47 | function test() { 48 | enterFunc ("test"); 49 | printBugNumber(BUGNUMBER); 50 | printStatus (stat); 51 | 52 | expect = 'PASS'; 53 | 54 | function f() 55 | { 56 | try 57 | { 58 | throw 'PASS'; 59 | } 60 | catch(e) 61 | { 62 | return e; 63 | } 64 | } 65 | 66 | actual = f(); 67 | 68 | reportCompare(expect, actual, stat); 69 | 70 | exitFunc ("test"); 71 | } 72 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Exceptions/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Exceptions'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/ExecutionContexts/10.1.3.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = '10.1.3.js'; 42 | 43 | /** 44 | ECMA Section: 10.1.3: Variable Instantiation 45 | FunctionDeclarations are processed before VariableDeclarations, and 46 | VariableDeclarations don't replace existing values with undefined 47 | */ 48 | 49 | test(); 50 | 51 | function f() 52 | { 53 | var x; 54 | 55 | return typeof x; 56 | 57 | function x() 58 | { 59 | return 7; 60 | } 61 | } 62 | 63 | function test() 64 | { 65 | enterFunc ("test"); 66 | 67 | printStatus ("ECMA Section: 10.1.3: Variable Instantiation."); 68 | printBugNumber (17290); 69 | 70 | reportCompare ("function", f(), "Declaration precedence test"); 71 | 72 | exitFunc("test"); 73 | } 74 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/ExecutionContexts/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/ExecutionContexts/ 2 | script 10.1.3-1.js 3 | script 10.1.3-2.js 4 | script 10.1.3.js 5 | script 10.1.4-1.js 6 | script 10.6.1-01.js 7 | script regress-23346.js 8 | script regress-448595-01.js 9 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/ExecutionContexts/regress-23346.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'regress-23346.js'; 42 | 43 | var CALL_CALLED = "PASSED"; 44 | 45 | test(); 46 | 47 | function f(x) 48 | { 49 | if (x) 50 | return call(); 51 | 52 | return "FAILED!"; 53 | } 54 | 55 | function call() 56 | { 57 | return CALL_CALLED; 58 | } 59 | 60 | function test() 61 | { 62 | enterFunc ("test"); 63 | 64 | printStatus ("ECMA Section: 10.1.3: Variable Instantiation."); 65 | printBugNumber (23346); 66 | 67 | reportCompare ("PASSED", f(true), 68 | "Unqualified reference should not see Function.prototype"); 69 | 70 | exitFunc("test"); 71 | } 72 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/ExecutionContexts/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'ExecutionContexts'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Expressions/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Expressions/ 2 | script 11.10-01.js 3 | script 11.10-02.js 4 | script 11.10-03.js 5 | script 11.6.1-1.js 6 | script 11.7.1-01.js 7 | script 11.7.2-01.js 8 | script 11.7.3-01.js 9 | script 11.9.6-1.js 10 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Expressions/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Expressions'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/FunExpr/fe-002.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Mozilla Communicator client code, released 17 | * March 31, 1998. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1998 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Rob Ginda rginda@netscape.com 26 | * 27 | * Alternatively, the contents of this file may be used under the terms of 28 | * either the GNU General Public License Version 2 or later (the "GPL"), or 29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30 | * in which case the provisions of the GPL or the LGPL are applicable instead 31 | * of those above. If you wish to allow use of your version of this file only 32 | * under the terms of either the GPL or the LGPL, and not to allow others to 33 | * use your version of this file under the terms of the MPL, indicate your 34 | * decision by deleting the provisions above and replace them with the notice 35 | * and other provisions required by the GPL or the LGPL. If you do not delete 36 | * the provisions above, a recipient may use your version of this file under 37 | * the terms of any one of the MPL, the GPL or the LGPL. 38 | * 39 | * ***** END LICENSE BLOCK ***** */ 40 | 41 | var gTestfile = 'fe-002.js'; 42 | 43 | function f() 44 | { 45 | return "outer"; 46 | } 47 | 48 | function test() 49 | { 50 | enterFunc ("test"); 51 | printStatus ("Function Expression test."); 52 | 53 | var x = function f(){return "inner";}(); 54 | 55 | reportCompare ("outer", f(), 56 | "Inner function statement should not have been called."); 57 | 58 | exitFunc ("test"); 59 | } 60 | 61 | test(); 62 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/FunExpr/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/FunExpr/ 2 | script fe-001-n.js 3 | script fe-001.js 4 | script fe-002.js 5 | script regress-518103.js 6 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/FunExpr/regress-518103.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Any copyright is dedicated to the Public Domain. 3 | * http://creativecommons.org/licenses/publicdomain/ 4 | */ 5 | 6 | var gTestfile = 'regress-518103.js'; 7 | var BUGNUMBER = 518103; 8 | var summary = 'lambda constructor "method" vs. instanceof'; 9 | var actual; 10 | var expect; 11 | 12 | printBugNumber(BUGNUMBER); 13 | printStatus(summary); 14 | 15 | var Y = {widget: {}}; 16 | 17 | Y.widget.DataSource = function () {}; 18 | Y.widget.DS_JSArray = function (A) { this.data = A; }; 19 | Y.widget.DS_JSArray.prototype = new Y.widget.DataSource(); 20 | 21 | var J = new Y.widget.DS_JSArray( [ ] ); 22 | 23 | actual = J instanceof Y.widget.DataSource; 24 | expect = true; 25 | 26 | reportCompare(expect, actual, summary); 27 | 28 | printStatus("All tests passed!"); 29 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/FunExpr/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'FunExpr'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Function/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Function/ 2 | script 15.3.4.3-1.js 3 | script 15.3.4.4-1.js 4 | script arguments-001.js 5 | script arguments-002.js 6 | script call-001.js 7 | script regress-131964.js 8 | script regress-137181.js 9 | script regress-193555.js 10 | script regress-313570.js 11 | script regress-49286.js 12 | script regress-58274.js 13 | script regress-85880.js 14 | script regress-94506.js 15 | script regress-97921.js 16 | script scope-001.js 17 | script scope-002.js 18 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Function/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Function'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Number/15.7.4.3-02.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Jeff Walden. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Philip Taylor 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '15.7.4.3-02.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = "446494"; 41 | var summary = "num.toLocaleString should handle exponents"; 42 | var actual, expect; 43 | 44 | printBugNumber(BUGNUMBER); 45 | printStatus(summary); 46 | 47 | expect = '1e-10'; 48 | actual = 1e-10.toLocaleString(); 49 | reportCompare(expect, actual, summary + ': ' + expect); 50 | 51 | expect = 'Infinity'; 52 | actual = Infinity.toLocaleString(); 53 | reportCompare(expect, actual, summary + ': ' + expect); 54 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Number/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Number/ 2 | script 15.7.4.2-01.js 3 | script 15.7.4.3-01.js 4 | script 15.7.4.3-02.js 5 | script 15.7.4.5-1.js 6 | script 15.7.4.5-2.js 7 | fails script 15.7.4.6-1.js 8 | fails script 15.7.4.7-1.js 9 | script 15.7.4.7-2.js 10 | script regress-442242-01.js 11 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Number/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Number'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Object/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Object/ 2 | script 8.6.1-01.js 3 | script 8.6.2.6-001.js 4 | fails script 8.6.2.6-002.js 5 | script class-001.js 6 | script class-002.js 7 | script class-003.js 8 | script class-004.js 9 | script class-005.js 10 | script regress-361274.js 11 | script regress-385393-07.js 12 | script regress-459405.js 13 | script regress-72773.js 14 | script regress-79129-001.js 15 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Object/regress-361274.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2006 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jason Sachs 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-361274.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 361274; 41 | var summary = 'Embedded nulls in property names'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | var x='123'+'\0'+'456'; 57 | var y='123'+'\0'+'789'; 58 | var a={}; 59 | a[x]=1; 60 | a[y]=2; 61 | 62 | reportCompare(1, a[x], summary + ': 123\\0456'); 63 | reportCompare(2, a[y], summary + ': 123\\0789'); 64 | 65 | exitFunc ('test'); 66 | } 67 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Object/regress-459405.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | * Any copyright is dedicated to the Public Domain. 4 | * http://creativecommons.org/licenses/publicdomain/ 5 | * Contributor: Robert Sayre 6 | */ 7 | 8 | var gTestfile = 'regress-459405.js'; 9 | //----------------------------------------------------------------------------- 10 | var BUGNUMBER = 459405; 11 | var summary = 'Math is not ReadOnly'; 12 | var actual = ''; 13 | var expect = ''; 14 | 15 | 16 | //----------------------------------------------------------------------------- 17 | test(); 18 | //----------------------------------------------------------------------------- 19 | 20 | function test() 21 | { 22 | enterFunc ('test'); 23 | printBugNumber(BUGNUMBER); 24 | printStatus (summary); 25 | 26 | expect = 'foo'; 27 | 28 | try 29 | { 30 | var Math = 'foo'; 31 | actual = Math; 32 | } 33 | catch(ex) 34 | { 35 | actual = ex + ''; 36 | } 37 | 38 | reportCompare(expect, actual, summary); 39 | 40 | exitFunc ('test'); 41 | } 42 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Operators/11.13.1-002.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Seno.Aiko@gmail.com 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '11.13.1-002.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 312354; 41 | var summary = '11.13.1 Simple Assignment should return type of RHS'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | // XXX this test should really test each property of the native 46 | // objects, but I'm too lazy. Patches accepted. 47 | 48 | printBugNumber(BUGNUMBER); 49 | printStatus (summary); 50 | 51 | var re = /x/g; 52 | var y = re.lastIndex = "7"; 53 | 54 | expect = "string"; 55 | actual = typeof y; 56 | 57 | reportCompare(expect, actual, summary); 58 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Operators/11.4.1-002.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): x0 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '11.4.1-002.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 423300; 41 | var summary = '11.4.1 - The delete Operator - delete f()'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function f() {} 51 | 52 | function test() 53 | { 54 | enterFunc ('test'); 55 | printBugNumber(BUGNUMBER); 56 | printStatus (summary); 57 | 58 | expect = true; 59 | 60 | try 61 | { 62 | actual = delete f(); 63 | } 64 | catch(ex) 65 | { 66 | actual = ex + ''; 67 | } 68 | 69 | reportCompare(expect, actual, summary); 70 | 71 | exitFunc ('test'); 72 | } 73 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Operators/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Operators/ 2 | script 11.13.1-001.js 3 | script 11.13.1-002.js 4 | script 11.4.1-001.js 5 | script 11.4.1-002.js 6 | fails script order-01.js 7 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Operators/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Operators'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Readme.txt: -------------------------------------------------------------------------------- 1 | These are a portion of the Mozilla SpiderMonkey test suite: 2 | 3 | http://mxr.mozilla.org/mozilla/source/js/tests/ecma_3/ 4 | 5 | Omitted Tests 6 | ============= 7 | 8 | A list of tests we have deleted: 9 | 10 | - extensions/*.js tests various extensions to ECMA, that we do not model. 11 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Regress/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/Regress/ 2 | script regress-385393-04.js 3 | script regress-419152.js 4 | script regress-420087.js 5 | script regress-420610.js 6 | script regress-441477-01.js 7 | script regress-469937.js 8 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Regress/regress-420087.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Mike Shaver 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-420087.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 420087; 41 | var summary = 'Do not assert: PCVCAP_MAKE(sprop->shape, 0, 0) == entry->vcap'; 42 | var actual = 'No Crash'; 43 | var expect = 'No Crash'; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | var dict; 57 | 58 | for (var i = 0; i < 2; i++) 59 | dict = {p: 1, q: 1, p:1}; 60 | 61 | reportCompare(expect, actual, summary); 62 | 63 | exitFunc ('test'); 64 | } 65 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Regress/regress-441477-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | * Any copyright is dedicated to the Public Domain. 4 | * http://creativecommons.org/licenses/publicdomain/ 5 | * Contributor: Jason Orendorff 6 | */ 7 | 8 | var gTestfile = 'regress-441477-01.js'; 9 | //----------------------------------------------------------------------------- 10 | var BUGNUMBER = 441477-01; 11 | var summary = ''; 12 | var actual = 'No Exception'; 13 | var expect = 'No Exception'; 14 | 15 | 16 | //----------------------------------------------------------------------------- 17 | test(); 18 | //----------------------------------------------------------------------------- 19 | 20 | function test() 21 | { 22 | enterFunc ('test'); 23 | printBugNumber(BUGNUMBER); 24 | printStatus (summary); 25 | 26 | try 27 | { 28 | for (i = 0; i < 5;) 29 | { 30 | if (i > 5) 31 | throw "bad"; 32 | i++; 33 | continue; 34 | } 35 | } 36 | catch(ex) 37 | { 38 | actual = ex + ''; 39 | } 40 | reportCompare(expect, actual, summary); 41 | 42 | exitFunc ('test'); 43 | } 44 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Regress/regress-469937.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Jesse Ruderman 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-469937.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 469937; 41 | var summary = 'Properties without DontEnum are sometimes not enumerated'; 42 | var actual = false; 43 | var expect = true; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | (function(){ 49 | var o = { } 50 | o.PageLeft = 1; 51 | o.Rect2 = 6; 52 | delete o.Rect2; 53 | for (var p in o); 54 | o.Rect3 = 7; 55 | found = false; 56 | for (var p in o) if (p == 'Rect3') found = true; 57 | actual = found; 58 | })(); 59 | 60 | reportCompare(expect, actual, summary); -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Regress/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Regress'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Statements/12.10-01.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2008 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Brendan Eich 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '12.10-01.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 462734; 41 | var summary = 'evaluating lhs "Reference" *before* evaluating rhs'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | 46 | //----------------------------------------------------------------------------- 47 | test(); 48 | //----------------------------------------------------------------------------- 49 | 50 | function test() 51 | { 52 | enterFunc ('test'); 53 | printBugNumber(BUGNUMBER); 54 | printStatus (summary); 55 | 56 | var x = 1; 57 | var o = {}; 58 | with (o) 59 | x = o.x = 2; 60 | print(x); 61 | 62 | expect = 4; 63 | actual = x + o.x; 64 | 65 | reportCompare(expect, actual, summary); 66 | 67 | exitFunc ('test'); 68 | } 69 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Statements/12.6.3.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Bryant Chen 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = '12.6.3.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 292731; 41 | var summary = 'for-in should not call valueOf method'; 42 | var actual = ''; 43 | var expect = ''; 44 | var i; 45 | 46 | printBugNumber(BUGNUMBER); 47 | printStatus (summary); 48 | 49 | function MyObject() 50 | { 51 | } 52 | 53 | MyObject.prototype.valueOf = function() 54 | { 55 | actual += 'MyObject.prototype.valueOf called. '; 56 | } 57 | 58 | var myobject = new MyObject(); 59 | 60 | var myfunction = new function() 61 | { 62 | this.valueOf = function() 63 | { 64 | actual += 'this.valueOf called. '; 65 | } 66 | } 67 | 68 | actual = ''; 69 | for (i in myobject) 70 | { 71 | //calls valueOf 72 | } 73 | reportCompare(expect, actual, 'for-in custom object'); 74 | 75 | actual = ''; 76 | for (i in myfunction) 77 | { 78 | //calls valueOf 79 | } 80 | reportCompare(expect, actual, 'for-in function expression'); 81 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/Statements/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'Statements'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/String/jstests.list: -------------------------------------------------------------------------------- 1 | url-prefix ../../jsreftest.html?test=ecma_3/String/ 2 | fails script 15.5.4.11.js 3 | script 15.5.4.14.js 4 | script regress-104375.js 5 | script regress-189898.js 6 | script regress-304376.js 7 | script regress-313567.js 8 | fails script regress-392378.js 9 | script regress-83293.js 10 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/String/regress-313567.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is JavaScript Engine testing utilities. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Mozilla Foundation. 19 | * Portions created by the Initial Developer are Copyright (C) 2005 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): Igor Bukanov 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | var gTestfile = 'regress-313567.js'; 39 | //----------------------------------------------------------------------------- 40 | var BUGNUMBER = 313567; 41 | var summary = 'String.prototype.length should not be generic'; 42 | var actual = ''; 43 | var expect = ''; 44 | 45 | printBugNumber(BUGNUMBER); 46 | printStatus (summary); 47 | 48 | var s = new String("1"); 49 | s.toString = function() { 50 | return "22"; 51 | } 52 | var expect = 1; 53 | var actual = s.length; 54 | printStatus("expect="+expect+" actual="+actual); 55 | 56 | reportCompare(expect, actual, summary); 57 | -------------------------------------------------------------------------------- /haskell/Tests/SpiderMonkey/String/shell.js: -------------------------------------------------------------------------------- 1 | gTestsubsuite = 'String'; 2 | -------------------------------------------------------------------------------- /haskell/Tests/UnitTests/arrays.tst: -------------------------------------------------------------------------------- 1 | { 2 | //basics: 3 | result = (["a", "b", "c"])[0]; 4 | } :: "a"; 5 | { 6 | result = (["a", "b", "c"])["1"]; 7 | } :: "b"; 8 | { 9 | result = (["a", "b", "c"])[1+1]; 10 | } :: "c"; 11 | { 12 | result = (["a", "b", "c"])[5]; 13 | } :: undefined; 14 | 15 | { 16 | //arrays act like objects for non-uint indices 17 | a = [5, 9, 10]; 18 | a.bob = 13; 19 | a["gas"] = 5; 20 | result = a["bob"] + a.gas; 21 | } :: 18; 22 | 23 | { 24 | //NON-UINT INDICES 25 | a = [1, 2, 3]; 26 | a[84.2] = 5; 27 | a[-4] = 9; 28 | result = a.length; 29 | } :: 3; 30 | 31 | { 32 | //constructor should work too 33 | var z = new Array("1", "2", "3", "5"); 34 | result = z.length + z[0] + z[1] + z[2] + z[3]; 35 | } :: "41235"; 36 | 37 | { 38 | var z = new Array(); 39 | result = (z.length+"") + z[0]; 40 | } :: "0undefined"; 41 | 42 | { 43 | var z = new Array(300); 44 | result = z.length; 45 | } :: 300; 46 | 47 | { 48 | //non-constructor should behave the same 49 | var z = Array("1", "2", "3", "5"); 50 | result = z.length + z[0] + z[1] + z[2] + z[3]; 51 | } :: "41235"; 52 | 53 | { 54 | var z = Array(); 55 | result = (z.length+"") + z[0]; 56 | } :: "0undefined"; 57 | 58 | { 59 | var z = Array(300); 60 | result = z.length; 61 | } :: 300; 62 | 63 | { 64 | //setting a higher element extends the length 65 | var ary = [1, 2, 3]; 66 | ary[10] = "HAHA"; 67 | result = (ary.length); 68 | } :: 11; 69 | 70 | { 71 | //setting length to a low # deletes things: 72 | var ary = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 73 | ary.length = 2; 74 | result = ary[5]; 75 | } :: undefined; 76 | 77 | //testing push 78 | { 79 | var a = ["xom"]; 80 | a.push(1); 81 | a.push("hey", "bye"); 82 | result = ""; 83 | result += a[0]; 84 | result += a[1]; 85 | result += a[2]; 86 | result += a[3]; 87 | result += a.length; 88 | } :: "xom1heybye4"; 89 | //and pop 90 | { 91 | var arry = ["a", "b", "c"]; 92 | result = ""; 93 | result += arry.pop(); 94 | result += arry[0]; 95 | result += arry[1]; 96 | result += arry[2]; 97 | result += arry.length; 98 | } :: "cabundefined2"; 99 | { 100 | var arry = []; 101 | result = ""; 102 | result += arry.pop(); 103 | result += arry[0]; 104 | result += arry.length; 105 | } :: "undefinedundefined0"; 106 | 107 | { 108 | //array constructor working in every way 109 | var z = Array(1, 2, 3); 110 | result = "" + (z[0] + z[1] + z[2]); 111 | z.blorka = Array; 112 | 113 | var f = new z.blorka(4, 5); 114 | result += ("" + (f[0] + f[1])); 115 | var g = z.blorka(6, 7); 116 | result += ("" + (g[0] + g[1])); 117 | } :: "6913"; -------------------------------------------------------------------------------- /haskell/Tests/UnitTests/basic.tst: -------------------------------------------------------------------------------- 1 | { 2 | //do whatever you want, and store a value in 'result' 3 | //test will pass if result contains waht the 4 | //thing after :: desugars to 5 | result = 4 + 3; 6 | } :: 7; 7 | 8 | { 9 | result = ({toString:function(){return 4.0;}}) + 9.2; 10 | } :: 13.2; 11 | 12 | { 13 | result = { foo : 4545 } 14 | } :: { foo : 4545 }; 15 | 16 | { 17 | //ensure to-string can modify 'this' things 18 | var z = {toString: function() { 19 | this.x = 49; 20 | return "hey"; 21 | }}; 22 | var q = z+""; 23 | result = z.x; 24 | } :: 49; 25 | 26 | { 27 | //ensure prototype look-up works 28 | function Point() { 29 | this.x = 5; 30 | } 31 | Point.prototype = {y: 12}; 32 | p = new Point(); 33 | result = p.y; 34 | } :: 12; 35 | 36 | { 37 | //ensure ands work w/ tostring 38 | var z = {toString: function() { 39 | this.x = 49; 40 | return "hey"; 41 | }}; 42 | var q = (true && z) + ""; 43 | result = z.x; 44 | } :: 49; 45 | 46 | { 47 | //check short circuiting 48 | var z = {toString: function() { 49 | this.x = 49; 50 | return "hey"; 51 | }}; 52 | var q = (false && z) + ""; 53 | result = z.x; 54 | } :: undefined; 55 | 56 | { 57 | //ensure ands work w/ tostring 58 | var z = {valueOf: function() { 59 | this.x = 49; 60 | return "hey"; 61 | }}; 62 | var q = (true && z) + ""; 63 | result = z.x; 64 | } :: 49; 65 | 66 | { 67 | //check short circuiting 68 | var z = {valueOf: function() { 69 | this.x = 49; 70 | return "hey"; 71 | }}; 72 | var q = (false && z) + ""; 73 | result = z.x; 74 | } :: undefined; 75 | //order of operations for listexprs 76 | { 77 | result = ""; 78 | (result += "1", result += "2", result += "3"); 79 | } :: "123"; 80 | //complex lvalues work 81 | { 82 | result = ""; 83 | var x = {y: 10}; 84 | (result += "1", result += "2", result += "3", x).y = 13; 85 | result += "|" + x.y; 86 | } :: "123|13"; 87 | { 88 | result = ""; 89 | var x = {y: 10}; 90 | (result += "1", result += "2", result += "3", x)['y'] = 13; 91 | result += "|" + x['y']; 92 | } :: "123|13"; 93 | //lvalues are not evaluated twice with complex assign exprs 94 | { 95 | var x = {y: 10}; 96 | var y = 5; 97 | (y++, x).y += 5; 98 | result = "" + y + "|" + x.y; 99 | } :: "6|15"; 100 | { 101 | var x = {y: 10}; 102 | var y = 5; 103 | (y++, x)['y'] += 5; 104 | result = "" + y + "|" + x['y']; 105 | } :: "6|15"; 106 | 107 | 108 | -------------------------------------------------------------------------------- /haskell/Tests/UnitTests/delete.tst: -------------------------------------------------------------------------------- 1 | //testing delete 2 | { 3 | var z = 50; 4 | result = ""+z; 5 | result = result + (delete z); 6 | if (typeof z == "undefined") result += "deleted"; 7 | } :: "50truedeleted"; 8 | 9 | { 10 | var obj = {a: 10, b: 30, c: 40}; 11 | result = ""; 12 | result += (obj.c); 13 | result += (delete obj.c); 14 | result += (obj.c); 15 | result += (delete obj.nothere); 16 | result += (obj.nothere); 17 | } :: "40trueundefinedtrueundefined"; 18 | 19 | -------------------------------------------------------------------------------- /haskell/Tests/UnitTests/exceptions.tst: -------------------------------------------------------------------------------- 1 | { 2 | //if you can't convert an object to a primitive, that's a type error 3 | actual = "No error"; 4 | try 5 | { 6 | var obj = {toString: function() {return new Object();}} 7 | obj == 'abc'; 8 | } 9 | catch(e) 10 | { 11 | if (e instanceof TypeError) 12 | actual = "Pass"; 13 | else 14 | actual = "Fail"; 15 | } 16 | 17 | result = actual; 18 | } :: "Pass"; 19 | 20 | { 21 | //apply expects arguments or array 22 | result = "No error"; 23 | var x = function() {}; 24 | try { 25 | x.apply(null, "HEY"); 26 | } 27 | catch (e) { 28 | result = (e instanceof TypeError); 29 | } 30 | } :: true; -------------------------------------------------------------------------------- /haskell/Tests/UnitTests/forin.tst: -------------------------------------------------------------------------------- 1 | { 2 | //regular for loops iterating properly 3 | result = ""; 4 | var z = 1; 5 | for (var i=0; i $testPath || failure 31 | ./impl.$goldImpl $testPath > $goldOutput || failure3rd 32 | #third party must have PASSED every test 33 | didfail=`grep FAILED $goldOutput` 34 | if [[ $didfail != "" ]]; 35 | then 36 | failure3rd 37 | fi 38 | 39 | newImpl=lambdajs 40 | ./impl.$newImpl $testPath > $newOutput || failure 41 | diff=`diff $goldOutput $newOutput` 42 | expected=`echo -e "\n"` 43 | if [[ $diff == $expected ]]; then 44 | #do nothing 45 | z=0 46 | else 47 | echo $diff 48 | failure 49 | fi 50 | 51 | echo "Success on $1" 52 | -------------------------------------------------------------------------------- /haskell/data/prelude.js: -------------------------------------------------------------------------------- 1 | Array.prototype.join = function (separator) { 2 | var l = this.length; 3 | if (separator === undefined) separator = ","; 4 | separator = "" + separator; 5 | if (l === 0) return ""; 6 | var R = this[0]; 7 | if (R === undefined || R === null) 8 | R = ""; 9 | else 10 | R = ""+R; 11 | for (var k = 1; k < l; ++k) { 12 | var S = R + separator; 13 | var x = this[k]; 14 | if (x === undefined || x === null) { 15 | R = S + ""; 16 | } 17 | else 18 | R = S + (""+x); 19 | } 20 | return R; 21 | }; 22 | 23 | Array.prototype.toLocaleString = function () { 24 | var l = this.length; 25 | var separator = ","; 26 | if (l === 0) return ""; 27 | var R = this[0]; 28 | if (R === undefined || R === null) 29 | R = ""; 30 | else 31 | R = R.toLocaleString(); 32 | for (var k = 1; k < l; ++k) { 33 | var S = R + separator; 34 | var x = this[k]; 35 | if (x === undefined || x === null) { 36 | R = S + ""; 37 | } 38 | else 39 | R = S + (x.toLocaleString()); 40 | } 41 | return R; 42 | }; 43 | 44 | // TODO: ES3 specifies quicksort! 45 | Array.prototype.sort = function (comparefn) { 46 | var l = this.length; 47 | var sortCompare = function(x,y) { 48 | if (x === undefined && y === undefined) return 0; 49 | if (x === undefined) return 1; 50 | if (y === undefined) return -1; 51 | if (comparefn === undefined) { 52 | var xs = ""+x; var ys = ""+y; 53 | if (xs < ys) return -1; 54 | if (ys < xs) return 1; 55 | return 0; 56 | } 57 | return comparefn(x,y); 58 | }; 59 | 60 | for (var i=0; i oneOf "$_@", 28 | identLetter = alphaNum <|> oneOf "$_-><", 29 | opStart = oneOf "{}<>()~.,?:|&^=!+-*/%![]", 30 | opLetter = oneOf "=<>|&+", 31 | reservedNames = [ "true", "false", "fun", "let", "in", "and", "ref", 32 | "delete", "if", "then", "else", "while", "do", "label", 33 | "break", "throw", "try", "catch", "finally", "typeof", 34 | "op" ], 35 | reservedOpNames = [ ".", ",", "{", "}", "(", ")", "=", ":=", "!", "[", "]", 36 | ";", "&&", "||" ], 37 | caseSensitive = False 38 | } 39 | 40 | lex :: T.TokenParser st 41 | lex = T.makeTokenParser def 42 | 43 | -- everything but commaSep and semiSep 44 | identifier = T.identifier lex 45 | reserved = T.reserved lex 46 | operator = T.operator lex 47 | reservedOp = T.reservedOp lex 48 | charLiteral = T.charLiteral lex 49 | stringLiteral = T.stringLiteral lex 50 | natural = T.natural lex 51 | integer = T.integer lex 52 | float = T.float lex 53 | naturalOrFloat = T.naturalOrFloat lex 54 | decimal = T.decimal lex 55 | hexadecimal = T.hexadecimal lex 56 | octal = T.octal lex 57 | symbol = T.symbol lex 58 | whiteSpace = T.whiteSpace lex 59 | parens = T.parens lex 60 | braces = T.braces lex 61 | squares = T.squares lex 62 | semi = T.semi lex 63 | comma = T.comma lex 64 | colon = T.colon lex 65 | dot = T.dot lex 66 | brackets = T.brackets lex 67 | lexeme = T.lexeme lex 68 | -------------------------------------------------------------------------------- /haskell/src/Language/LambdaJS/LiftFuncStmts.hs: -------------------------------------------------------------------------------- 1 | -- |Lifts function statements to the enclosing block, and turn them into 2 | -- function expressions. 3 | module Language.LambdaJS.LiftFuncStmts 4 | ( liftFuncStmts 5 | ) where 6 | 7 | import Language.LambdaJS.Prelude 8 | import Language.ECMAScript3 9 | import Data.Generics 10 | 11 | isFuncExpr :: Expression SourcePos -> Bool 12 | isFuncExpr (FuncExpr{}) = True 13 | isFuncExpr _ = False 14 | 15 | 16 | isFuncStmt :: Statement SourcePos -> Bool 17 | isFuncStmt (FunctionStmt{}) = True 18 | isFuncStmt _ = False 19 | 20 | 21 | isNewScope :: Data a => a -> Bool 22 | isNewScope = mkQ False (isFuncExpr `extQ` isFuncStmt) 23 | 24 | 25 | collectFuncStmts :: Data a 26 | => a 27 | -> [Statement SourcePos] 28 | collectFuncStmts = collectExclude (not.isNewScope) isFuncStmt 29 | 30 | 31 | removeFuncStmts :: Data a => a -> a 32 | removeFuncStmts = everywhereUpto isNewScope (mkT toEmptyStmt) 33 | where toEmptyStmt :: Statement SourcePos -> Statement SourcePos 34 | toEmptyStmt (FunctionStmt p _ _ _) = EmptyStmt p 35 | toEmptyStmt s = s 36 | 37 | 38 | funcStmtToVarDecl :: Statement SourcePos 39 | -> Statement SourcePos 40 | funcStmtToVarDecl (FunctionStmt p x args body) = 41 | VarDeclStmt p [VarDecl p x (Just expr)] 42 | where expr = FuncExpr p Nothing args body 43 | funcStmtToVarDecl s = 44 | error $ "LiftFuncStmts.hs : expected FunctionStmt, got " ++ show s 45 | 46 | liftFuncStmts :: [Statement SourcePos] 47 | -> [Statement SourcePos] 48 | liftFuncStmts stmts = varDecls ++ stmts' 49 | where stmts' = removeFuncStmts stmts 50 | varDecls = map funcStmtToVarDecl (collectFuncStmts stmts) 51 | -------------------------------------------------------------------------------- /haskell/src/Language/LambdaJS/LocalVars.hs: -------------------------------------------------------------------------------- 1 | module Language.LambdaJS.LocalVars 2 | ( localVars 3 | ) where 4 | 5 | import Language.ECMAScript3.Syntax 6 | 7 | varDecl :: VarDecl a -> Id a 8 | varDecl (VarDecl a x _ ) = x 9 | 10 | 11 | forInit :: ForInit a -> [Id a] 12 | forInit (VarInit decls) = map varDecl decls 13 | forInit _ = [] 14 | 15 | 16 | forInInit :: ForInInit a -> [Id a] 17 | forInInit (ForInVar x) = [x] 18 | forInInit _ = [] 19 | 20 | 21 | caseClause :: CaseClause a -> [Id a] 22 | caseClause (CaseClause _ e ss) = concatMap stmt ss 23 | caseClause (CaseDefault _ ss) = concatMap stmt ss 24 | 25 | 26 | catchClause :: CatchClause a -> [Id a] 27 | catchClause (CatchClause _ x s) = stmt s 28 | 29 | 30 | stmt :: Statement a -> [Id a] 31 | stmt s = case s of 32 | VarDeclStmt _ decls -> map varDecl decls 33 | ForInStmt _ init _ s -> forInInit init ++ stmt s 34 | ForStmt _ init _ _ s -> forInit init ++ stmt s 35 | BlockStmt _ ss -> concatMap stmt ss 36 | EmptyStmt _ -> [] 37 | ExprStmt _ _ -> [] 38 | IfStmt _ _ s1 s2 -> stmt s1 ++ stmt s2 39 | IfSingleStmt _ _ s1 -> stmt s1 40 | SwitchStmt _ _ clauses -> concatMap caseClause clauses 41 | WhileStmt _ _ s -> stmt s 42 | DoWhileStmt _ s _ -> stmt s 43 | BreakStmt _ _ -> [] 44 | ContinueStmt _ _ -> [] 45 | LabelledStmt _ _ s -> stmt s 46 | TryStmt _ s catches finally -> 47 | stmt s ++ maybe [] catchClause catches ++ maybe [] stmt finally 48 | ThrowStmt _ _ -> [] 49 | ReturnStmt _ _ -> [] 50 | WithStmt _ _ s -> stmt s 51 | FunctionStmt _ name _ _ -> [name] 52 | 53 | 54 | localVars :: Statement a -> [String] 55 | localVars = filter ((/=) "arguments") . map unId . stmt 56 | -------------------------------------------------------------------------------- /haskell/src/Language/LambdaJS/Prelude.hs: -------------------------------------------------------------------------------- 1 | module Language.LambdaJS.Prelude 2 | ( collectExclude 3 | , everywhereUpto 4 | , everythingUpto 5 | , SourcePos 6 | , Set 7 | ) where 8 | 9 | import Data.Generics 10 | import Data.Set (Set) 11 | import Text.ParserCombinators.Parsec.Pos (SourcePos, initialPos) 12 | 13 | collectExclude :: Data r 14 | => GenericQ Bool -- ^descend into a subtree? 15 | -> (r -> Bool) -- ^return the node? 16 | -> GenericQ [r] 17 | collectExclude canDescend doReturn x = case canDescend x of 18 | False -> [] 19 | True -> 20 | (mkQ [] f x) ++ (concat $ gmapQ (collectExclude canDescend doReturn) x) 21 | where f r = case doReturn r of 22 | True -> [r] 23 | False -> [] 24 | 25 | -- | Similar to 'everything', but only applies the query to nodes that satisfy 26 | -- the predicate. We do apply the query when 'canDescend' is 'False', but we 27 | -- do not recur. 28 | -- 29 | -- It is possible to do approximately the same operation with 'everything', but 30 | -- this interface is a lot simpler. 31 | everythingUpto :: GenericQ Bool -- ^descend into a subtree? 32 | -> (r -> r -> r) 33 | -> GenericQ r 34 | -> GenericQ r 35 | everythingUpto canDescend combine query x = case canDescend x of 36 | False -> query x 37 | True -> foldl combine 38 | (query x) 39 | (gmapQ (everythingUpto canDescend combine query) x) 40 | 41 | 42 | -- | Descends into all nodes that satisfy the predicate. The transformer 43 | -- is applied to all nodes, including nodes at which descent stops. 44 | everywhereUpto :: GenericQ Bool -> GenericT -> GenericT 45 | everywhereUpto q f x = case q x of 46 | True -> f x 47 | False -> f (gmapT (everywhereUpto q f) x) 48 | -------------------------------------------------------------------------------- /haskell/src/Language/LambdaJS/RemoveHOAS.hs: -------------------------------------------------------------------------------- 1 | module Language.LambdaJS.RemoveHOAS 2 | ( removeHOAS 3 | ) where 4 | 5 | import Control.Monad.State 6 | import Control.Monad 7 | import Language.LambdaJS.Syntax 8 | 9 | 10 | type M a = State Int a 11 | 12 | 13 | newVar :: M Ident 14 | newVar = do 15 | n <- get 16 | put (n + 1) 17 | return ("$" ++ show n) 18 | 19 | 20 | expr :: Expr a -> M (Expr a) 21 | expr e = case e of 22 | ENumber a _ -> return e 23 | EString a _ -> return e 24 | EBool a _ -> return e 25 | EUndefined a -> return e 26 | ENull a -> return e 27 | ELambda a xs e1 -> liftM (ELambda a xs) (expr e1) 28 | EObject a props -> do 29 | vals <- mapM expr (map snd props) 30 | return (EObject a (zip (map fst props) vals)) 31 | EId a _ -> return e 32 | EOp a op es -> liftM (EOp a op) (mapM expr es) 33 | EApp a e1 es -> liftM2 (EApp a) (expr e1) (mapM expr es) 34 | ELet a binds e1 -> do 35 | vals <- mapM expr (map snd binds) 36 | e1' <- expr e1 37 | return (ELet a (zip (map fst binds) vals) e1') 38 | ELet1 a e1 f -> do 39 | x <- newVar 40 | e1' <- expr e1 41 | e2' <- expr (f x) 42 | return (ELet a [(x, e1')] e2') 43 | ELet2 a e1 e2 f -> do 44 | x <- newVar 45 | y <- newVar 46 | e1' <- expr e1 47 | e2' <- expr e2 48 | e3' <- expr (f x y) 49 | return (ELet a [(x, e1'), (y, e2')] e3') 50 | ESetRef a e1 e2 -> liftM2 (ESetRef a) (expr e1) (expr e2) 51 | ERef a e1 -> liftM (ERef a) (expr e1) 52 | EDeref a e1 -> liftM (EDeref a) (expr e1) 53 | EGetField a e1 e2 -> liftM2 (EGetField a) (expr e1) (expr e2) 54 | EDeleteField a e1 e2 -> liftM2 (EDeleteField a) (expr e1) (expr e2) 55 | EUpdateField a e1 e2 e3 -> liftM3 (EUpdateField a) (expr e1) (expr e2) (expr e3) 56 | ESeq a e1 e2 -> liftM2 (ESeq a) (expr e1) (expr e2) 57 | EIf a e1 e2 e3 -> liftM3 (EIf a) (expr e1) (expr e2) (expr e3) 58 | EWhile a e1 e2 -> liftM2 (EWhile a) (expr e1) (expr e2) 59 | ELabel a lbl e1 -> liftM (ELabel a lbl) (expr e1) 60 | EBreak a lbl e1 -> liftM (EBreak a lbl) (expr e1) 61 | EThrow a e1 -> liftM (EThrow a) (expr e1) 62 | ECatch a e1 e2 -> liftM2 (ECatch a) (expr e1) (expr e2) 63 | EFinally a e1 e2 -> liftM2 (EFinally a) (expr e1) (expr e2) 64 | EEval a -> return e 65 | 66 | 67 | removeHOAS :: Expr a -> Expr a 68 | removeHOAS e = evalState (expr e) 0 69 | -------------------------------------------------------------------------------- /haskell/unit-test-one.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ] 4 | then 5 | echo "Usage: `basename $0` testname.js" 6 | exit 65 7 | fi 8 | 9 | ./dist/build/lambdaJS/lambdaJS --test-cases < $1 | ../Redex/test-shell.ss 10 | -------------------------------------------------------------------------------- /haskell/unit-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for file in `find Tests/UnitTests -name "*.tst"` 4 | do 5 | echo "Running test suite $file..." 6 | ./dist/build/lambdaJS/lambdaJS --test-cases < $file | ../Redex/test-shell.ss 7 | done 8 | --------------------------------------------------------------------------------