diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
| commit | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch) | |
| tree | d49911209b132da58d838efa852daf28d516df21 /JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions | |
| parent | 87eb0cb35bad8784770ebc807e6c982432e47107 (diff) | |
| download | external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2 | |
Initial Contribution
Diffstat (limited to 'JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions')
3 files changed, 91 insertions, 0 deletions
diff --git a/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/keywords-001.js b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/keywords-001.js new file mode 100644 index 0000000..19e930d --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/keywords-001.js @@ -0,0 +1,31 @@ +/** + * File Name: + * ECMA Section: + * Description: + * + * + * Author: christine@netscape.com + * Date: 11 August 1998 + */ + var SECTION = ""; + var VERSION = "ECMA_2"; + var TITLE = "Keywords"; + + startTest(); + + var result = "failed"; + + try { + eval("super;"); + } + catch (x) { + if (x instanceof SyntaxError) + result = x.name; + } + + AddTestCase( + "using the expression \"super\" shouldn't cause js to crash", + "SyntaxError", + result ); + + test(); diff --git a/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-001.js b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-001.js new file mode 100644 index 0000000..6af945b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-001.js @@ -0,0 +1,38 @@ +/** + * File Name: LexicalConventions/regexp-literals-001.js + * ECMA Section: 7.8.5 + * Description: + * + * + * Author: christine@netscape.com + * Date: 11 August 1998 + */ + var SECTION = "LexicalConventions/regexp-literals-001.js"; + var VERSION = "ECMA_2"; + var TITLE = "Regular Expression Literals"; + + startTest(); + + // Regular Expression Literals may not be empty; // should be regarded + // as a comment, not a RegExp literal. + + s = //; + + "passed"; + + AddTestCase( + "// should be a comment, not a regular expression literal", + "passed", + String(s)); + + AddTestCase( + "// typeof object should be type of object declared on following line", + "passed", + (typeof s) == "string" ? "passed" : "failed" ); + + AddTestCase( + "// should not return an object of the type RegExp", + "passed", + (typeof s == "object") ? "failed" : "passed" ); + + test(); diff --git a/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-002.js b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-002.js new file mode 100644 index 0000000..c67184b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma_2/LexicalConventions/regexp-literals-002.js @@ -0,0 +1,22 @@ +/** + * File Name: LexicalConventions/regexp-literals-002.js + * ECMA Section: 7.8.5 + * Description: Based on ECMA 2 Draft 8 October 1999 + * + * Author: christine@netscape.com + * Date: 19 February 1999 + */ + var SECTION = "LexicalConventions/regexp-literals-002.js"; + var VERSION = "ECMA_2"; + var TITLE = "Regular Expression Literals"; + + startTest(); + + // A regular expression literal represents an object of type RegExp. + + AddTestCase( + "// A regular expression literal represents an object of type RegExp.", + "true", + (/x*/ instanceof RegExp).toString() ); + + test(); |
