~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/tests/js1_8_5/regress/regress-699682.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Any copyright is dedicated to the Public Domain.
 
2
// http://creativecommons.org/licenses/publicdomain/
 
3
 
 
4
// Don't assert trying to parse any of these.
 
5
var a = ["({''})",
 
6
         "({''} = {})",
 
7
         "var {''};",
 
8
         "var {'', a} = {a: 0};",
 
9
         "var {'bad'};",
 
10
         "({'bad'} = {bad: 0});",
 
11
         "var {'if'};",
 
12
         "function f({''}) {}",
 
13
         "function f({a, 'bad', c}) {}"];
 
14
 
 
15
var x;
 
16
for (var i = 0; i < a.length; i++) {
 
17
    x = undefined;
 
18
    try {
 
19
        eval(a[i]);
 
20
    } catch (exc) {
 
21
        x = exc;
 
22
    }
 
23
    assertEq(x instanceof SyntaxError, true);
 
24
}
 
25
assertEq("" in this, false);
 
26
assertEq("bad" in this, false);
 
27
assertEq("if" in this, false);
 
28
 
 
29
reportCompare(0, 0, 'ok');