Advertisement
Guest User

toolkit/modules/Sqlite.jsm

a guest
Mar 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.91 KB | None | 0 0
  1. diff --git a/toolkit/modules/Sqlite.jsm b/toolkit/modules/Sqlite.jsm
  2. index 986198e6b4fd..a9b1bed32499 100644
  3. --- a/toolkit/modules/Sqlite.jsm
  4. +++ b/toolkit/modules/Sqlite.jsm
  5. @@ -5,7 +5,7 @@
  6.  "use strict";
  7.  
  8.  var EXPORTED_SYMBOLS = [
  9. -  "Sqlite",
  10. +    "Sqlite",
  11.  ];
  12.  
  13.  // The maximum time to wait before considering a transaction stuck and rejecting
  14. @@ -13,21 +13,25 @@ var EXPORTED_SYMBOLS = [
  15.  // the `_getTimeoutPromise` method on `ConnectionData` for details).
  16.  const TRANSACTIONS_QUEUE_TIMEOUT_MS = 300000; // 5 minutes
  17.  
  18. -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
  19. -const {setTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
  20. +const {
  21. +    XPCOMUtils
  22. +} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
  23. +const {
  24. +    setTimeout
  25. +} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
  26.  
  27.  XPCOMUtils.defineLazyModuleGetters(this, {
  28. -  AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
  29. -  Services: "resource://gre/modules/Services.jsm",
  30. -  OS: "resource://gre/modules/osfile.jsm",
  31. -  Log: "resource://gre/modules/Log.jsm",
  32. -  FileUtils: "resource://gre/modules/FileUtils.jsm",
  33. -  PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
  34. +    AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
  35. +    Services: "resource://gre/modules/Services.jsm",
  36. +    OS: "resource://gre/modules/osfile.jsm",
  37. +    Log: "resource://gre/modules/Log.jsm",
  38. +    FileUtils: "resource://gre/modules/FileUtils.jsm",
  39. +    PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
  40.  });
  41.  
  42.  XPCOMUtils.defineLazyServiceGetter(this, "FinalizationWitnessService",
  43. -                                   "@mozilla.org/toolkit/finalizationwitness;1",
  44. -                                   "nsIFinalizationWitnessService");
  45. +    "@mozilla.org/toolkit/finalizationwitness;1",
  46. +    "nsIFinalizationWitnessService");
  47.  
  48.  // Regular expression used by isInvalidBoundLikeQuery
  49.  var likeSqlRegex = /\bLIKE\b\s(?![@:?])/i;
  50. @@ -48,10 +52,10 @@ var wrappedConnections = new Set();
  51.  var isClosed = false;
  52.  
  53.  var Debugging = {
  54. -  // Tests should fail if a connection auto closes.  The exception is
  55. -  // when finalization itself is tested, in which case this flag
  56. -  // should be set to false.
  57. -  failTestsOnAutoClose: true,
  58. +    // Tests should fail if a connection auto closes.  The exception is
  59. +    // when finalization itself is tested, in which case this flag
  60. +    // should be set to false.
  61. +    failTestsOnAutoClose: true,
  62.  };
  63.  
  64.  /**
  65. @@ -60,26 +64,26 @@ var Debugging = {
  66.   * @param sql
  67.   *        (string) The SQL query to be verified.
  68.   * @return boolean value telling us whether query was correct or not
  69. -*/
  70. + */
  71.  function isInvalidBoundLikeQuery(sql) {
  72. -  return likeSqlRegex.test(sql);
  73. +    return likeSqlRegex.test(sql);
  74.  }
  75.  
  76.  // Displays a script error message
  77.  function logScriptError(message) {
  78. -  let consoleMessage = Cc["@mozilla.org/scripterror;1"].
  79. -                       createInstance(Ci.nsIScriptError);
  80. -  let stack = new Error();
  81. -  consoleMessage.init(message, stack.fileName, null, stack.lineNumber, 0,
  82. -                      Ci.nsIScriptError.errorFlag, "component javascript");
  83. -  Services.console.logMessage(consoleMessage);
  84. -
  85. -  // This `Promise.reject` will cause tests to fail.  The debugging
  86. -  // flag can be used to suppress this for tests that explicitly
  87. -  // test auto closes.
  88. -  if (Debugging.failTestsOnAutoClose) {
  89. -    Promise.reject(new Error(message));
  90. -  }
  91. +    let consoleMessage = Cc["@mozilla.org/scripterror;1"].
  92. +    createInstance(Ci.nsIScriptError);
  93. +    let stack = new Error();
  94. +    consoleMessage.init(message, stack.fileName, null, stack.lineNumber, 0,
  95. +        Ci.nsIScriptError.errorFlag, "component javascript");
  96. +    Services.console.logMessage(consoleMessage);
  97. +
  98. +    // This `Promise.reject` will cause tests to fail.  The debugging
  99. +    // flag can be used to suppress this for tests that explicitly
  100. +    // test auto closes.
  101. +    if (Debugging.failTestsOnAutoClose) {
  102. +        Promise.re
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement