Bug 1216668 - Move Parser.jsm to devtools/shared so the webconsole server can use it;r=jryans
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 21 Oct 2015 07:09:39 -0700
changeset 303864 b491da27641b5c0d7357b1e5584bf156ead8a107
parent 303863 f5d4d72d777215106e7ed8c8ddf326e9dc159734
child 303865 9c494af00cfb40168b415f40c2341071189122ba
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1216668
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1216668 - Move Parser.jsm to devtools/shared so the webconsole server can use it;r=jryans
devtools/client/debugger/debugger-controller.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-01.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-02.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-03.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-04.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-05.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-06.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-07.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-08.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-09.js
devtools/client/debugger/test/mochitest/browser_dbg_parser-10.js
devtools/client/shared/Parser.jsm
devtools/client/shared/moz.build
devtools/shared/Parser.jsm
devtools/shared/moz.build
--- a/devtools/client/debugger/debugger-controller.js
+++ b/devtools/client/debugger/debugger-controller.js
@@ -117,17 +117,17 @@ const {Tooltip} = require("devtools/clie
 const FastListWidget = require("devtools/client/shared/widgets/FastListWidget");
 
 XPCOMUtils.defineConstant(this, "EVENTS", EVENTS);
 
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
   "resource://gre/modules/Task.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Parser",
-  "resource:///modules/devtools/client/shared/Parser.jsm");
+  "resource://gre/modules/devtools/shared/Parser.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
   "resource://gre/modules/ShortcutUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
   "@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
 
 Object.defineProperty(this, "NetworkHelper", {
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-01.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that simple JS can be parsed and cached with the reflection API.
  */
 
 function test() {
-  let { Parser } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { Parser } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let source = "let x = 42;";
   let parser = new Parser();
   let first = parser.get(source);
   let second = parser.get(source);
 
   isnot(first, second,
     "The two syntax trees should be different.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-02.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that syntax errors are reported correctly.
  */
 
 function test() {
-  let { Parser } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { Parser } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let source = "let x + 42;";
   let parser = new Parser();
   // Don't pollute the logs with exceptions that we are going to check anyhow.
   parser.logExceptions = false;
   let parsed = parser.get(source);
 
   ok(parsed,
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-03.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that JS inside HTML can be separated and parsed correctly.
  */
 
 function test() {
-  let { Parser } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { Parser } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let source = [
     "<!doctype html>",
     "<head>",
       "<script>",
         "let a = 42;",
       "</script>",
       "<script type='text/javascript'>",
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-04.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-04.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that faulty JS inside HTML can be separated and identified correctly.
  */
 
 function test() {
-  let { Parser } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { Parser } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let source = [
     "<!doctype html>",
     "<head>",
       "<SCRIPT>",
         "let a + 42;",
       "</SCRIPT>",
       "<script type='text/javascript'>",
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-05.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-05.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that JS code containing strings that might look like <script> tags
  * inside an HTML source is parsed correctly.
  */
 
 function test() {
-  let { Parser } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { Parser } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let source = [
     "let a = [];",
     "a.push('<script>');",
     "a.push('var a = 42;');",
     "a.push('</script>');",
     "a.push('<script type=\"text/javascript\">');",
     "a.push('var b = 42;');",
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-06.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-06.js
@@ -3,17 +3,17 @@
 
 /**
  * Check that some potentially problematic identifier nodes have the
  * right location information attached.
  */
 
 function test() {
   let { Parser, ParserHelpers, SyntaxTreeVisitor } =
-    Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+    Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   function verify(source, predicate, [sline, scol], [eline, ecol]) {
     let ast = Parser.reflectionAPI.parse(source);
     let node = SyntaxTreeVisitor.filter(ast, predicate).pop();
     let loc = ParserHelpers.getNodeLocation(node);
 
     is(loc.start.toSource(), { line: sline, column: scol }.toSource(),
       "The start location was correct for the identifier in: '" + source + "'.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-07.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-07.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check that nodes with locaiton information attached can be properly
  * verified for containing lines and columns.
  */
 
 function test() {
-  let { ParserHelpers } = Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+  let { ParserHelpers } = Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   let node1 = { loc: {
     start: { line: 1, column: 10 },
     end: { line: 10, column: 1 }
   }};
   let node2 = { loc: {
     start: { line: 1, column: 10 },
     end: { line: 1, column: 20 }
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-08.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-08.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that inferring anonymous function information is done correctly.
  */
 
 function test() {
   let { Parser, ParserHelpers, SyntaxTreeVisitor } =
-    Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+    Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   function verify(source, predicate, details) {
     let { name, chain } = details;
     let [[sline, scol], [eline, ecol]] = details.loc;
     let ast = Parser.reflectionAPI.parse(source);
     let node = SyntaxTreeVisitor.filter(ast, predicate).pop();
     let info = ParserHelpers.inferFunctionExpressionInfo(node);
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-09.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-09.js
@@ -3,17 +3,17 @@
 
 /**
  * Test that inferring anonymous function information is done correctly
  * from arrow expressions.
  */
 
 function test() {
   let { Parser, ParserHelpers, SyntaxTreeVisitor } =
-    Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+    Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   function verify(source, predicate, details) {
     let { name, chain } = details;
     let [[sline, scol], [eline, ecol]] = details.loc;
     let ast = Parser.reflectionAPI.parse(source);
     let node = SyntaxTreeVisitor.filter(ast, predicate).pop();
     let info = ParserHelpers.inferFunctionExpressionInfo(node);
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_parser-10.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_parser-10.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that creating an evaluation string for certain nodes works properly.
  */
 
 function test() {
   let { Parser, ParserHelpers, SyntaxTreeVisitor } =
-    Cu.import("resource:///modules/devtools/client/shared/Parser.jsm", {});
+    Cu.import("resource://gre/modules/devtools/shared/Parser.jsm", {});
 
   function verify(source, predicate, string) {
     let ast = Parser.reflectionAPI.parse(source);
     let node = SyntaxTreeVisitor.filter(ast, predicate).pop();
     let info = ParserHelpers.getIdentifierEvalString(node);
     is(info, string, "The identifier evaluation string is correct.");
   }
 
--- a/devtools/client/shared/moz.build
+++ b/devtools/client/shared/moz.build
@@ -25,17 +25,16 @@ DevToolsModules(
     'doorhanger.js',
     'frame-script-utils.js',
     'getjson.js',
     'inplace-editor.js',
     'Jsbeautify.jsm',
     'node-attribute-parser.js',
     'observable-object.js',
     'options-view.js',
-    'Parser.jsm',
     'poller.js',
     'source-utils.js',
     'SplitView.jsm',
     'telemetry.js',
     'theme-switching.js',
     'theme.js',
     'undo.js'
 )
rename from devtools/client/shared/Parser.jsm
rename to devtools/shared/Parser.jsm
--- a/devtools/shared/moz.build
+++ b/devtools/shared/moz.build
@@ -39,11 +39,12 @@ DevToolsModules(
     'css-color.js',
     'deprecated-sync-thenables.js',
     'DevToolsUtils.js',
     'event-emitter.js',
     'event-parsers.js',
     'indentation.js',
     'Loader.jsm',
     'output-parser.js',
+    'Parser.jsm',
     'path.js',
     'system.js',
 )