changeset 1230:b3c9cf883e3a

8075240: Output of some tests contains platform specific line break Reviewed-by: sundar
author slugovoy
date Wed, 25 Mar 2015 14:39:39 +0300
parents 21ddb7e58ab8
children 5895d96a6a55
files test/script/nosecurity/parserapi.js test/script/nosecurity/parserapi.js.EXPECTED test/script/nosecurity/treeapi/utils.js
diffstat 3 files changed, 334 insertions(+), 308 deletions(-) [+]
line wrap: on
line diff
--- a/test/script/nosecurity/parserapi.js	Wed Mar 25 14:36:22 2015 +0530
+++ b/test/script/nosecurity/parserapi.js	Wed Mar 25 14:39:39 2015 +0300
@@ -97,7 +97,7 @@
            var parser = new Parser();
            var tree = parser.parse(subdir + "/" + file.name, script,
                function(diagnostic) {
-                   print(JSON.stringify(parser.convert(diagnostic), null, 2));
+                   print(JSON.stringify(parser.convert(diagnostic), null, 2).replace(/\\r/g, ''));
                    print(",");
                });
 
--- a/test/script/nosecurity/parserapi.js.EXPECTED	Wed Mar 25 14:36:22 2015 +0530
+++ b/test/script/nosecurity/parserapi.js.EXPECTED	Wed Mar 25 14:39:39 2015 +0300
@@ -1,4 +1,4 @@
-[
+[
 {
   "endPosition": "1113",
   "kind": "COMPILATION_UNIT",
@@ -132,8 +132,8 @@
   "sourceName": "parsertests/array_literal.js",
   "strict": "false",
   "startPosition": "1113"
-}
-,
+}
+,
 {
   "endPosition": "1126",
   "kind": "COMPILATION_UNIT",
@@ -406,8 +406,8 @@
   "sourceName": "parsertests/assignmentExpr.js",
   "strict": "false",
   "startPosition": "1126"
-}
-,
+}
+,
 {
   "endPosition": "1116",
   "kind": "COMPILATION_UNIT",
@@ -912,8 +912,8 @@
   "sourceName": "parsertests/binaryExpr.js",
   "strict": "false",
   "startPosition": "1116"
-}
-,
+}
+,
 {
   "endPosition": "1117",
   "kind": "COMPILATION_UNIT",
@@ -959,8 +959,8 @@
   "sourceName": "parsertests/block.js",
   "strict": "false",
   "startPosition": "1117"
-}
-,
+}
+,
 {
   "endPosition": "1117",
   "kind": "COMPILATION_UNIT",
@@ -1060,8 +1060,8 @@
   "sourceName": "parsertests/breakStat.js",
   "strict": "false",
   "startPosition": "1117"
-}
-,
+}
+,
 {
   "endPosition": "1117",
   "kind": "COMPILATION_UNIT",
@@ -1098,8 +1098,8 @@
   "sourceName": "parsertests/condExpr.js",
   "strict": "false",
   "startPosition": "1117"
-}
-,
+}
+,
 {
   "endPosition": "1120",
   "kind": "COMPILATION_UNIT",
@@ -1199,8 +1199,8 @@
   "sourceName": "parsertests/continueStat.js",
   "strict": "false",
   "startPosition": "1120"
-}
-,
+}
+,
 {
   "endPosition": "1118",
   "kind": "COMPILATION_UNIT",
@@ -1214,8 +1214,8 @@
   "sourceName": "parsertests/debuggerStat.js",
   "strict": "false",
   "startPosition": "1118"
-}
-,
+}
+,
 {
   "endPosition": "1137",
   "kind": "COMPILATION_UNIT",
@@ -1500,8 +1500,8 @@
   "sourceName": "parsertests/functions.js",
   "strict": "false",
   "startPosition": "1137"
-}
-,
+}
+,
 {
   "endPosition": "1114",
   "kind": "COMPILATION_UNIT",
@@ -1604,8 +1604,8 @@
   "sourceName": "parsertests/ifStat.js",
   "strict": "false",
   "startPosition": "1114"
-}
-,
+}
+,
 {
   "endPosition": "1113",
   "kind": "COMPILATION_UNIT",
@@ -1668,8 +1668,8 @@
   "sourceName": "parsertests/labelledStat.js",
   "strict": "false",
   "startPosition": "1113"
-}
-,
+}
+,
 {
   "endPosition": "1125",
   "kind": "COMPILATION_UNIT",
@@ -2066,8 +2066,8 @@
   "sourceName": "parsertests/lhsExpr.js",
   "strict": "false",
   "startPosition": "1125"
-}
-,
+}
+,
 {
   "endPosition": "1110",
   "kind": "COMPILATION_UNIT",
@@ -2350,8 +2350,8 @@
   "sourceName": "parsertests/loopStat.js",
   "strict": "false",
   "startPosition": "1110"
-}
-,
+}
+,
 {
   "endPosition": "1125",
   "kind": "COMPILATION_UNIT",
@@ -2705,8 +2705,8 @@
   "sourceName": "parsertests/objectLitExpr.js",
   "strict": "false",
   "startPosition": "1125"
-}
-,
+}
+,
 {
   "endPosition": "1118",
   "kind": "COMPILATION_UNIT",
@@ -2781,8 +2781,8 @@
   "sourceName": "parsertests/parenExpr.js",
   "strict": "false",
   "startPosition": "1118"
-}
-,
+}
+,
 {
   "endPosition": "1119",
   "kind": "COMPILATION_UNIT",
@@ -2995,8 +2995,8 @@
   "sourceName": "parsertests/primaryExpr.js",
   "strict": "false",
   "startPosition": "1119"
-}
-,
+}
+,
 {
   "endPosition": "1114",
   "kind": "COMPILATION_UNIT",
@@ -3044,8 +3044,8 @@
   "sourceName": "parsertests/regexp_literal.js",
   "strict": "false",
   "startPosition": "1114"
-}
-,
+}
+,
 {
   "endPosition": "1118",
   "kind": "COMPILATION_UNIT",
@@ -3144,8 +3144,8 @@
   "sourceName": "parsertests/returnStat.js",
   "strict": "false",
   "startPosition": "1118"
-}
-,
+}
+,
 {
   "endPosition": "1111",
   "kind": "COMPILATION_UNIT",
@@ -3309,8 +3309,8 @@
   "sourceName": "parsertests/switchStat.js",
   "strict": "false",
   "startPosition": "1111"
-}
-,
+}
+,
 {
   "endPosition": "1110",
   "kind": "COMPILATION_UNIT",
@@ -3421,8 +3421,8 @@
   "sourceName": "parsertests/throwStat.js",
   "strict": "false",
   "startPosition": "1110"
-}
-,
+}
+,
 {
   "endPosition": "1121",
   "kind": "COMPILATION_UNIT",
@@ -3783,8 +3783,8 @@
   "sourceName": "parsertests/tryCatchStat.js",
   "strict": "false",
   "startPosition": "1121"
-}
-,
+}
+,
 {
   "endPosition": "1115",
   "kind": "COMPILATION_UNIT",
@@ -3969,8 +3969,8 @@
   "sourceName": "parsertests/unaryExpr.js",
   "strict": "false",
   "startPosition": "1115"
-}
-,
+}
+,
 {
   "endPosition": "1122",
   "kind": "COMPILATION_UNIT",
@@ -4016,8 +4016,8 @@
   "sourceName": "parsertests/useStrict.js",
   "strict": "true",
   "startPosition": "1122"
-}
-,
+}
+,
 {
   "endPosition": "1143",
   "kind": "COMPILATION_UNIT",
@@ -4092,8 +4092,8 @@
   "sourceName": "parsertests/varDecl.js",
   "strict": "false",
   "startPosition": "1143"
-}
-,
+}
+,
 {
   "endPosition": "1111",
   "kind": "COMPILATION_UNIT",
@@ -4142,8 +4142,8 @@
   "sourceName": "parsertests/withStat.js",
   "strict": "false",
   "startPosition": "1111"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/caseoutofswitch.js",
   "code": "case (1090, 4)",
@@ -4152,8 +4152,8 @@
   "position": "1090",
   "message": "parsernegativetests/caseoutofswitch.js:29:0 Expected an operand but found case\ncase 23:\n^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/caseoutofswitch.js",
   "code": "default (1112, 7)",
@@ -4162,8 +4162,8 @@
   "position": "1112",
   "message": "parsernegativetests/caseoutofswitch.js:31:0 Expected an operand but found default\ndefault:\n^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4240,8 +4240,8 @@
   "sourceName": "parsernegativetests/caseoutofswitch.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegalbreak.js",
   "code": "break (1090, 5)",
@@ -4250,8 +4250,8 @@
   "position": "1090",
   "message": "parsernegativetests/illegalbreak.js:29:0 Illegal break statement\nbreak;\n^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegalbreak.js",
   "code": "ident (1103, 3)",
@@ -4260,8 +4260,8 @@
   "position": "1103",
   "message": "parsernegativetests/illegalbreak.js:30:6 Undefined Label \"foo\"\nbreak foo;\n      ^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4290,8 +4290,8 @@
   "sourceName": "parsernegativetests/illegalbreak.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegalcontinue.js",
   "code": "continue (1090, 8)",
@@ -4300,8 +4300,8 @@
   "position": "1090",
   "message": "parsernegativetests/illegalcontinue.js:29:0 Illegal continue statement\ncontinue;\n^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegalcontinue.js",
   "code": "ident (1109, 3)",
@@ -4310,8 +4310,8 @@
   "position": "1109",
   "message": "parsernegativetests/illegalcontinue.js:30:9 Undefined Label \"foo\"\ncontinue foo;\n         ^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4340,8 +4340,8 @@
   "sourceName": "parsernegativetests/illegalcontinue.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegallvalue.js",
   "code": "decimal (1090, 2)",
@@ -4350,8 +4350,8 @@
   "position": "1090",
   "message": "parsernegativetests/illegallvalue.js:29:0 Invalid left hand side for assignment\n44 = 54;\n^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegallvalue.js",
   "code": "decimal (1099, 3)",
@@ -4360,8 +4360,8 @@
   "position": "1099",
   "message": "parsernegativetests/illegallvalue.js:30:0 Invalid left hand side for assignment\n233 += 33;\n^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegallvalue.js",
   "code": "decimal (1110, 4)",
@@ -4370,8 +4370,8 @@
   "position": "1110",
   "message": "parsernegativetests/illegallvalue.js:31:0 Invalid left hand side for assignment\n3423 -= 234;\n^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4410,8 +4410,8 @@
   "sourceName": "parsernegativetests/illegallvalue.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/illegaloperator.js",
   "code": "* (1093, 1)",
@@ -4420,8 +4420,8 @@
   "position": "1093",
   "message": "parsernegativetests/illegaloperator.js:29:3 Expected an operand but found *\nx ** y\n   ^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4440,8 +4440,8 @@
   "sourceName": "parsernegativetests/illegaloperator.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/keywordident.js",
   "code": "var (1094, 3)",
@@ -4450,8 +4450,8 @@
   "position": "1094",
   "message": "parsernegativetests/keywordident.js:29:4 Expected ident but found var\nvar var = 23;\n    ^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4482,8 +4482,8 @@
   "sourceName": "parsernegativetests/keywordident.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/parenmissing.js",
   "code": "; (1096, 1)",
@@ -4492,8 +4492,8 @@
   "position": "1096",
   "message": "parsernegativetests/parenmissing.js:29:6 Expected ) but found ;\n(1 + 2;\n      ^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/parenmissing.js",
   "code": ") (1103, 1)",
@@ -4502,8 +4502,8 @@
   "position": "1103",
   "message": "parsernegativetests/parenmissing.js:30:5 Expected ; but found )\nx * y);\n     ^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4554,8 +4554,8 @@
   "sourceName": "parsernegativetests/parenmissing.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/repeatedproperty.js",
   "code": "ident (1111, 3)",
@@ -4564,8 +4564,8 @@
   "position": "1111",
   "message": "parsernegativetests/repeatedproperty.js:29:21 Property \"foo\" already defined\nvar obj = { foo: 34, get foo() { return 'hello' } };\n                     ^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/repeatedproperty.js",
   "code": "ident (1165, 3)",
@@ -4574,8 +4574,8 @@
   "position": "1165",
   "message": "parsernegativetests/repeatedproperty.js:30:22 Property \"foo\" already defined\nvar obj1 = { foo: 34, set foo(x) { } };\n                      ^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/repeatedproperty.js",
   "code": "ident (1205, 3)",
@@ -4584,8 +4584,8 @@
   "position": "1205",
   "message": "parsernegativetests/repeatedproperty.js:31:22 Property \"foo\" already defined\nvar obj2 = { foo: 34, set foo(x) { } };\n                      ^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/repeatedproperty.js",
   "code": "ident (1251, 3)",
@@ -4594,8 +4594,8 @@
   "position": "1251",
   "message": "parsernegativetests/repeatedproperty.js:32:28 Property \"bar\" already defined\nvar obj3 = { get bar() { }, get bar() {} };\n                            ^",
   "lineNumber": "32"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/repeatedproperty.js",
   "code": "ident (1296, 3)",
@@ -4604,8 +4604,8 @@
   "position": "1296",
   "message": "parsernegativetests/repeatedproperty.js:33:29 Property \"bar\" already defined\nvar obj4 = { set bar(x) { }, set bar(x) {} };\n                             ^",
   "lineNumber": "33"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4664,8 +4664,8 @@
   "sourceName": "parsernegativetests/repeatedproperty.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/strict_repeatedproperty.js",
   "code": "ident (1126, 3)",
@@ -4674,8 +4674,8 @@
   "position": "1126",
   "message": "parsernegativetests/strict_repeatedproperty.js:31:21 Property \"foo\" already defined\nvar obj = { foo: 34, foo: 'hello' };\n                     ^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4705,8 +4705,8 @@
   "sourceName": "parsernegativetests/strict_repeatedproperty.js",
   "strict": "true",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/strict_repeatparam.js",
   "code": "ident (1119, 1)",
@@ -4715,8 +4715,8 @@
   "position": "1119",
   "message": "parsernegativetests/strict_repeatparam.js:31:14 strict mode function cannot have duplicate parameter name \"x\"\nfunction func(x, x) {}\n              ^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4746,8 +4746,8 @@
   "sourceName": "parsernegativetests/strict_repeatparam.js",
   "strict": "true",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/strict_with.js",
   "code": "with (1105, 4)",
@@ -4756,8 +4756,8 @@
   "position": "1105",
   "message": "parsernegativetests/strict_with.js:31:0 \"with\" statement cannot be used in strict mode\nwith({}) {}\n^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/strict_with.js",
   "code": ") (1112, 1)",
@@ -4766,8 +4766,8 @@
   "position": "1112",
   "message": "parsernegativetests/strict_with.js:31:7 Expected ; but found )\nwith({}) {}\n       ^",
   "lineNumber": "31"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4807,8 +4807,8 @@
   "sourceName": "parsernegativetests/strict_with.js",
   "strict": "true",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/toplevelreturn.js",
   "code": "return (1090, 6)",
@@ -4817,8 +4817,8 @@
   "position": "1090",
   "message": "parsernegativetests/toplevelreturn.js:29:0 Invalid return statement\nreturn;\n^",
   "lineNumber": "29"
-}
-,
+}
+,
 {
   "fileName": "parsernegativetests/toplevelreturn.js",
   "code": "return (1098, 6)",
@@ -4827,8 +4827,8 @@
   "position": "1098",
   "message": "parsernegativetests/toplevelreturn.js:30:0 Invalid return statement\nreturn 23;\n^",
   "lineNumber": "30"
-}
-,
+}
+,
 {
   "endPosition": "1090",
   "kind": "COMPILATION_UNIT",
@@ -4857,8 +4857,8 @@
   "sourceName": "parsernegativetests/toplevelreturn.js",
   "strict": "false",
   "startPosition": "1090"
-}
-,
+}
+,
 {
   "endPosition": "1136",
   "kind": "COMPILATION_UNIT",
@@ -6189,11 +6189,11 @@
       "startPosition": "1972"
     },
     {
-      "endPosition": "3598",
+      "endPosition": "3618",
       "kind": "FUNCTION",
       "name": "processFiles",
       "body": {
-        "endPosition": "3555",
+        "endPosition": "3575",
         "kind": "BLOCK",
         "statements": [
           {
@@ -6335,7 +6335,7 @@
               "name": "files",
               "startPosition": "3053"
             },
-            "endPosition": "3555",
+            "endPosition": "3575",
             "kind": "FOR_IN_LOOP",
             "forEach": "true",
             "variable": {
@@ -6345,7 +6345,7 @@
               "startPosition": "3045"
             },
             "statement": {
-              "endPosition": "3555",
+              "endPosition": "3575",
               "kind": "BLOCK",
               "statements": [
                 {
@@ -6380,11 +6380,11 @@
                     ],
                     "startPosition": "3073"
                   },
-                  "endPosition": "3550",
+                  "endPosition": "3570",
                   "kind": "IF",
                   "startPosition": "3069",
                   "thenStatement": {
-                    "endPosition": "3550",
+                    "endPosition": "3570",
                     "kind": "BLOCK",
                     "statements": [
                       {
@@ -6436,12 +6436,12 @@
                         }
                       },
                       {
-                        "endPosition": "3415",
+                        "endPosition": "3435",
                         "kind": "VARIABLE",
                         "name": "tree",
                         "startPosition": "3196",
                         "initializer": {
-                          "endPosition": "3415",
+                          "endPosition": "3435",
                           "kind": "FUNCTION_INVOCATION",
                           "functionSelect": {
                             "identifier": "parse",
@@ -6500,12 +6500,12 @@
                               "endPosition": "3286",
                               "kind": "FUNCTION_EXPRESSION",
                               "body": {
-                                "endPosition": "3397",
+                                "endPosition": "3417",
                                 "kind": "BLOCK",
                                 "statements": [
                                   {
                                     "expression": {
-                                      "endPosition": "3365",
+                                      "endPosition": "3385",
                                       "kind": "FUNCTION_INVOCATION",
                                       "functionSelect": {
                                         "endPosition": "3312",
@@ -6515,90 +6515,116 @@
                                       },
                                       "arguments": [
                                         {
-                                          "endPosition": "3364",
+                                          "endPosition": "3384",
                                           "kind": "FUNCTION_INVOCATION",
                                           "functionSelect": {
-                                            "identifier": "stringify",
+                                            "identifier": "replace",
                                             "expression": {
-                                              "endPosition": "3317",
-                                              "kind": "IDENTIFIER",
-                                              "name": "JSON",
+                                              "endPosition": "3364",
+                                              "kind": "FUNCTION_INVOCATION",
+                                              "functionSelect": {
+                                                "identifier": "stringify",
+                                                "expression": {
+                                                  "endPosition": "3317",
+                                                  "kind": "IDENTIFIER",
+                                                  "name": "JSON",
+                                                  "startPosition": "3313"
+                                                },
+                                                "endPosition": "3327",
+                                                "kind": "MEMBER_SELECT",
+                                                "startPosition": "3313"
+                                              },
+                                              "arguments": [
+                                                {
+                                                  "endPosition": "3354",
+                                                  "kind": "FUNCTION_INVOCATION",
+                                                  "functionSelect": {
+                                                    "identifier": "convert",
+                                                    "expression": {
+                                                      "endPosition": "3334",
+                                                      "kind": "IDENTIFIER",
+                                                      "name": "parser",
+                                                      "startPosition": "3328"
+                                                    },
+                                                    "endPosition": "3342",
+                                                    "kind": "MEMBER_SELECT",
+                                                    "startPosition": "3328"
+                                                  },
+                                                  "arguments": [
+                                                    {
+                                                      "endPosition": "3353",
+                                                      "kind": "IDENTIFIER",
+                                                      "name": "diagnostic",
+                                                      "startPosition": "3343"
+                                                    }
+                                                  ],
+                                                  "startPosition": "3328"
+                                                },
+                                                {
+                                                  "endPosition": "3360",
+                                                  "kind": "NULL_LITERAL",
+                                                  "startPosition": "3356"
+                                                },
+                                                {
+                                                  "endPosition": "3363",
+                                                  "kind": "NUMBER_LITERAL",
+                                                  "value": "2",
+                                                  "startPosition": "3362"
+                                                }
+                                              ],
                                               "startPosition": "3313"
                                             },
-                                            "endPosition": "3327",
+                                            "endPosition": "3372",
                                             "kind": "MEMBER_SELECT",
                                             "startPosition": "3313"
                                           },
                                           "arguments": [
                                             {
-                                              "endPosition": "3354",
-                                              "kind": "FUNCTION_INVOCATION",
-                                              "functionSelect": {
-                                                "identifier": "convert",
-                                                "expression": {
-                                                  "endPosition": "3334",
-                                                  "kind": "IDENTIFIER",
-                                                  "name": "parser",
-                                                  "startPosition": "3328"
-                                                },
-                                                "endPosition": "3342",
-                                                "kind": "MEMBER_SELECT",
-                                                "startPosition": "3328"
-                                              },
-                                              "arguments": [
-                                                {
-                                                  "endPosition": "3353",
-                                                  "kind": "IDENTIFIER",
-                                                  "name": "diagnostic",
-                                                  "startPosition": "3343"
-                                                }
-                                              ],
-                                              "startPosition": "3328"
+                                              "endPosition": "3379",
+                                              "kind": "REGEXP_LITERAL",
+                                              "options": "g",
+                                              "pattern": "\\\\r",
+                                              "startPosition": "3373"
                                             },
                                             {
-                                              "endPosition": "3360",
-                                              "kind": "NULL_LITERAL",
-                                              "startPosition": "3356"
-                                            },
-                                            {
-                                              "endPosition": "3363",
-                                              "kind": "NUMBER_LITERAL",
-                                              "value": "2",
-                                              "startPosition": "3362"
+                                              "endPosition": "3382",
+                                              "kind": "STRING_LITERAL",
+                                              "value": "",
+                                              "startPosition": "3382"
                                             }
                                           ],
-                                          "startPosition": "3313"
+                                          "startPosition": "3372"
                                         }
                                       ],
                                       "startPosition": "3307"
                                     },
-                                    "endPosition": "3365",
+                                    "endPosition": "3385",
                                     "kind": "EXPRESSION_STATEMENT",
                                     "startPosition": "3307"
                                   },
                                   {
                                     "expression": {
-                                      "endPosition": "3396",
+                                      "endPosition": "3416",
                                       "kind": "FUNCTION_INVOCATION",
                                       "functionSelect": {
-                                        "endPosition": "3391",
+                                        "endPosition": "3411",
                                         "kind": "IDENTIFIER",
                                         "name": "print",
-                                        "startPosition": "3386"
+                                        "startPosition": "3406"
                                       },
                                       "arguments": [
                                         {
-                                          "endPosition": "3394",
+                                          "endPosition": "3414",
                                           "kind": "STRING_LITERAL",
                                           "value": ",",
-                                          "startPosition": "3393"
+                                          "startPosition": "3413"
                                         }
                                       ],
-                                      "startPosition": "3386"
+                                      "startPosition": "3406"
                                     },
-                                    "endPosition": "3396",
+                                    "endPosition": "3416",
                                     "kind": "EXPRESSION_STATEMENT",
-                                    "startPosition": "3386"
+                                    "startPosition": "3406"
                                   }
                                 ],
                                 "startPosition": "3286"
@@ -6621,107 +6647,107 @@
                       {
                         "condition": {
                           "leftOperand": {
-                            "endPosition": "3437",
+                            "endPosition": "3457",
                             "kind": "IDENTIFIER",
                             "name": "tree",
-                            "startPosition": "3433"
+                            "startPosition": "3453"
                           },
-                          "endPosition": "3445",
+                          "endPosition": "3465",
                           "kind": "NOT_EQUAL_TO",
                           "rightOperand": {
-                            "endPosition": "3445",
+                            "endPosition": "3465",
                             "kind": "NULL_LITERAL",
-                            "startPosition": "3441"
+                            "startPosition": "3461"
                           },
-                          "startPosition": "3433"
+                          "startPosition": "3453"
                         },
-                        "endPosition": "3541",
+                        "endPosition": "3561",
                         "kind": "IF",
-                        "startPosition": "3429",
+                        "startPosition": "3449",
                         "thenStatement": {
-                          "endPosition": "3541",
+                          "endPosition": "3561",
                           "kind": "BLOCK",
                           "statements": [
                             {
                               "expression": {
-                                "endPosition": "3500",
+                                "endPosition": "3520",
                                 "kind": "FUNCTION_INVOCATION",
                                 "functionSelect": {
-                                  "endPosition": "3469",
+                                  "endPosition": "3489",
                                   "kind": "IDENTIFIER",
                                   "name": "print",
-                                  "startPosition": "3464"
+                                  "startPosition": "3484"
                                 },
                                 "arguments": [
                                   {
-                                    "endPosition": "3499",
+                                    "endPosition": "3519",
                                     "kind": "FUNCTION_INVOCATION",
                                     "functionSelect": {
                                       "identifier": "stringify",
                                       "expression": {
-                                        "endPosition": "3474",
+                                        "endPosition": "3494",
                                         "kind": "IDENTIFIER",
                                         "name": "JSON",
-                                        "startPosition": "3470"
+                                        "startPosition": "3490"
                                       },
-                                      "endPosition": "3484",
+                                      "endPosition": "3504",
                                       "kind": "MEMBER_SELECT",
-                                      "startPosition": "3470"
+                                      "startPosition": "3490"
                                     },
                                     "arguments": [
                                       {
-                                        "endPosition": "3489",
+                                        "endPosition": "3509",
                                         "kind": "IDENTIFIER",
                                         "name": "tree",
-                                        "startPosition": "3485"
+                                        "startPosition": "3505"
                                       },
                                       {
-                                        "endPosition": "3495",
+                                        "endPosition": "3515",
                                         "kind": "NULL_LITERAL",
-                                        "startPosition": "3491"
+                                        "startPosition": "3511"
                                       },
                                       {
-                                        "endPosition": "3498",
+                                        "endPosition": "3518",
                                         "kind": "NUMBER_LITERAL",
                                         "value": "2",
-                                        "startPosition": "3497"
+                                        "startPosition": "3517"
                                       }
                                     ],
-                                    "startPosition": "3470"
+                                    "startPosition": "3490"
                                   }
                                 ],
-                                "startPosition": "3464"
+                                "startPosition": "3484"
                               },
-                              "endPosition": "3500",
+                              "endPosition": "3520",
                               "kind": "EXPRESSION_STATEMENT",
-                              "startPosition": "3464"
+                              "startPosition": "3484"
                             },
                             {
                               "expression": {
-                                "endPosition": "3527",
+                                "endPosition": "3547",
                                 "kind": "FUNCTION_INVOCATION",
                                 "functionSelect": {
-                                  "endPosition": "3522",
+                                  "endPosition": "3542",
                                   "kind": "IDENTIFIER",
                                   "name": "print",
-                                  "startPosition": "3517"
+                                  "startPosition": "3537"
                                 },
                                 "arguments": [
                                   {
-                                    "endPosition": "3525",
+                                    "endPosition": "3545",
                                     "kind": "STRING_LITERAL",
                                     "value": ",",
-                                    "startPosition": "3524"
+                                    "startPosition": "3544"
                                   }
                                 ],
-                                "startPosition": "3517"
+                                "startPosition": "3537"
                               },
-                              "endPosition": "3527",
+                              "endPosition": "3547",
                               "kind": "EXPRESSION_STATEMENT",
-                              "startPosition": "3517"
+                              "startPosition": "3537"
                             }
                           ],
-                          "startPosition": "3447"
+                          "startPosition": "3467"
                         }
                       }
                     ],
@@ -6748,268 +6774,268 @@
       ]
     },
     {
-      "endPosition": "3901",
+      "endPosition": "3921",
       "kind": "FUNCTION",
       "name": "main",
       "body": {
-        "endPosition": "3899",
+        "endPosition": "3919",
         "kind": "BLOCK",
         "statements": [
           {
             "expression": {
-              "endPosition": "3631",
+              "endPosition": "3651",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3626",
+                "endPosition": "3646",
                 "kind": "IDENTIFIER",
                 "name": "print",
-                "startPosition": "3621"
+                "startPosition": "3641"
               },
               "arguments": [
                 {
-                  "endPosition": "3629",
+                  "endPosition": "3649",
                   "kind": "STRING_LITERAL",
                   "value": "[",
-                  "startPosition": "3628"
+                  "startPosition": "3648"
                 }
               ],
-              "startPosition": "3621"
+              "startPosition": "3641"
             },
-            "endPosition": "3631",
+            "endPosition": "3651",
             "kind": "EXPRESSION_STATEMENT",
-            "startPosition": "3621"
+            "startPosition": "3641"
           },
           {
             "expression": {
-              "endPosition": "3665",
+              "endPosition": "3685",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3650",
+                "endPosition": "3670",
                 "kind": "IDENTIFIER",
                 "name": "processFiles",
-                "startPosition": "3638"
+                "startPosition": "3658"
               },
               "arguments": [
                 {
-                  "endPosition": "3663",
+                  "endPosition": "3683",
                   "kind": "STRING_LITERAL",
                   "value": "parsertests",
-                  "startPosition": "3652"
+                  "startPosition": "3672"
                 }
               ],
-              "startPosition": "3638"
+              "startPosition": "3658"
             },
-            "endPosition": "3665",
+            "endPosition": "3685",
             "kind": "EXPRESSION_STATEMENT",
-            "startPosition": "3638"
+            "startPosition": "3658"
           },
           {
             "expression": {
-              "endPosition": "3706",
+              "endPosition": "3726",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3683",
+                "endPosition": "3703",
                 "kind": "IDENTIFIER",
                 "name": "processFiles",
-                "startPosition": "3671"
+                "startPosition": "3691"
               },
               "arguments": [
                 {
-                  "endPosition": "3704",
+                  "endPosition": "3724",
                   "kind": "STRING_LITERAL",
                   "value": "parsernegativetests",
-                  "startPosition": "3685"
+                  "startPosition": "3705"
                 }
               ],
-              "startPosition": "3671"
+              "startPosition": "3691"
             },
-            "endPosition": "3706",
+            "endPosition": "3726",
             "kind": "EXPRESSION_STATEMENT",
-            "startPosition": "3671"
+            "startPosition": "3691"
           },
           {
-            "endPosition": "3775",
+            "endPosition": "3795",
             "kind": "VARIABLE",
             "name": "script",
-            "startPosition": "3747",
+            "startPosition": "3767",
             "initializer": {
-              "endPosition": "3775",
+              "endPosition": "3795",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3765",
+                "endPosition": "3785",
                 "kind": "IDENTIFIER",
                 "name": "readFully",
-                "startPosition": "3756"
+                "startPosition": "3776"
               },
               "arguments": [
                 {
-                  "endPosition": "3774",
+                  "endPosition": "3794",
                   "kind": "IDENTIFIER",
                   "name": "__FILE__",
-                  "startPosition": "3766"
+                  "startPosition": "3786"
                 }
               ],
-              "startPosition": "3756"
+              "startPosition": "3776"
             }
           },
           {
-            "endPosition": "3840",
+            "endPosition": "3860",
             "kind": "VARIABLE",
             "name": "tree",
-            "startPosition": "3785",
+            "startPosition": "3805",
             "initializer": {
-              "endPosition": "3840",
+              "endPosition": "3860",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
                 "identifier": "parse",
                 "expression": {
                   "constructorExpression": {
-                    "endPosition": "3804",
+                    "endPosition": "3824",
                     "kind": "FUNCTION_INVOCATION",
                     "functionSelect": {
-                      "endPosition": "3802",
+                      "endPosition": "3822",
                       "kind": "IDENTIFIER",
                       "name": "Parser",
-                      "startPosition": "3796"
+                      "startPosition": "3816"
                     },
                     "arguments": [],
-                    "startPosition": "3796"
+                    "startPosition": "3816"
                   },
-                  "endPosition": "3804",
+                  "endPosition": "3824",
                   "kind": "NEW",
-                  "startPosition": "3792"
+                  "startPosition": "3812"
                 },
-                "endPosition": "3810",
+                "endPosition": "3830",
                 "kind": "MEMBER_SELECT",
-                "startPosition": "3792"
+                "startPosition": "3812"
               },
               "arguments": [
                 {
-                  "endPosition": "3824",
+                  "endPosition": "3844",
                   "kind": "STRING_LITERAL",
                   "value": "parserapi.js",
-                  "startPosition": "3812"
+                  "startPosition": "3832"
                 },
                 {
-                  "endPosition": "3833",
+                  "endPosition": "3853",
                   "kind": "IDENTIFIER",
                   "name": "script",
-                  "startPosition": "3827"
+                  "startPosition": "3847"
                 },
                 {
-                  "endPosition": "3839",
+                  "endPosition": "3859",
                   "kind": "NULL_LITERAL",
-                  "startPosition": "3835"
+                  "startPosition": "3855"
                 }
               ],
-              "startPosition": "3792"
+              "startPosition": "3812"
             }
           },
           {
             "expression": {
-              "endPosition": "3882",
+              "endPosition": "3902",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3851",
+                "endPosition": "3871",
                 "kind": "IDENTIFIER",
                 "name": "print",
-                "startPosition": "3846"
+                "startPosition": "3866"
               },
               "arguments": [
                 {
-                  "endPosition": "3881",
+                  "endPosition": "3901",
                   "kind": "FUNCTION_INVOCATION",
                   "functionSelect": {
                     "identifier": "stringify",
                     "expression": {
-                      "endPosition": "3856",
+                      "endPosition": "3876",
                       "kind": "IDENTIFIER",
                       "name": "JSON",
-                      "startPosition": "3852"
+                      "startPosition": "3872"
                     },
-                    "endPosition": "3866",
+                    "endPosition": "3886",
                     "kind": "MEMBER_SELECT",
-                    "startPosition": "3852"
+                    "startPosition": "3872"
                   },
                   "arguments": [
                     {
-                      "endPosition": "3871",
+                      "endPosition": "3891",
                       "kind": "IDENTIFIER",
                       "name": "tree",
-                      "startPosition": "3867"
+                      "startPosition": "3887"
                     },
                     {
-                      "endPosition": "3877",
+                      "endPosition": "3897",
                       "kind": "NULL_LITERAL",
-                      "startPosition": "3873"
+                      "startPosition": "3893"
                     },
                     {
-                      "endPosition": "3880",
+                      "endPosition": "3900",
                       "kind": "NUMBER_LITERAL",
                       "value": "2",
-                      "startPosition": "3879"
+                      "startPosition": "3899"
                     }
                   ],
-                  "startPosition": "3852"
+                  "startPosition": "3872"
                 }
               ],
-              "startPosition": "3846"
+              "startPosition": "3866"
             },
-            "endPosition": "3882",
+            "endPosition": "3902",
             "kind": "EXPRESSION_STATEMENT",
-            "startPosition": "3846"
+            "startPosition": "3866"
           },
           {
             "expression": {
-              "endPosition": "3898",
+              "endPosition": "3918",
               "kind": "FUNCTION_INVOCATION",
               "functionSelect": {
-                "endPosition": "3893",
+                "endPosition": "3913",
                 "kind": "IDENTIFIER",
                 "name": "print",
-                "startPosition": "3888"
+                "startPosition": "3908"
               },
               "arguments": [
                 {
-                  "endPosition": "3896",
+                  "endPosition": "3916",
                   "kind": "STRING_LITERAL",
                   "value": "]",
-                  "startPosition": "3895"
+                  "startPosition": "3915"
                 }
               ],
-              "startPosition": "3888"
+              "startPosition": "3908"
             },
-            "endPosition": "3898",
+            "endPosition": "3918",
             "kind": "EXPRESSION_STATEMENT",
-            "startPosition": "3888"
+            "startPosition": "3908"
           }
         ],
-        "startPosition": "3615"
+        "startPosition": "3635"
       },
       "strict": "false",
-      "startPosition": "3599",
+      "startPosition": "3619",
       "parameters": []
     },
     {
       "expression": {
-        "endPosition": "3909",
+        "endPosition": "3929",
         "kind": "FUNCTION_INVOCATION",
         "functionSelect": {
-          "endPosition": "3907",
+          "endPosition": "3927",
           "kind": "IDENTIFIER",
           "name": "main",
-          "startPosition": "3903"
+          "startPosition": "3923"
         },
         "arguments": [],
-        "startPosition": "3903"
-      },
-      "endPosition": "3909",
+        "startPosition": "3923"
+      },
+      "endPosition": "3929",
       "kind": "EXPRESSION_STATEMENT",
-      "startPosition": "3903"
+      "startPosition": "3923"
     }
   ],
   "sourceName": "parserapi.js",
   "strict": "false",
   "startPosition": "1136"
-}
-]
+}
+]
--- a/test/script/nosecurity/treeapi/utils.js	Wed Mar 25 14:36:22 2015 +0530
+++ b/test/script/nosecurity/treeapi/utils.js	Wed Mar 25 14:39:39 2015 +0300
@@ -78,5 +78,5 @@
     var tree = parser.create(args).parse("test.js",  code, function (message) {
         messages.push(convert(message))
     })
-    print(JSON.stringify(messages, null, 2))
+    print(JSON.stringify(messages, null, 2).replace(/\\r/g, ''))
 }
\ No newline at end of file