[Pkg-mozext-commits] [greasemonkey] 32/45: Use external extractMeta module.

David Prévot taffit at moszumanska.debian.org
Mon Nov 3 20:59:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 140c0ef83abe285cbea8c8ef769ee7a2b622e564
Author: Ventero <ventero at ventero.de>
Date:   Thu Oct 2 23:30:37 2014 +0200

    Use external extractMeta module.
---
 modules/parseScript.js | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/modules/parseScript.js b/modules/parseScript.js
index 738ec3e..ee91dc2 100644
--- a/modules/parseScript.js
+++ b/modules/parseScript.js
@@ -1,5 +1,6 @@
-var EXPORTED_SYMBOLS = ['extractMeta', 'parse'];
+var EXPORTED_SYMBOLS = ['parse'];
 
+Components.utils.import('resource://greasemonkey/extractMeta.js');
 Components.utils.import('resource://greasemonkey/script.js');
 Components.utils.import('resource://greasemonkey/scriptIcon.js');
 Components.utils.import('resource://greasemonkey/scriptRequire.js');
@@ -9,23 +10,11 @@ Components.utils.import('resource://greasemonkey/util.js');
 
 var gIoService = Components.classes["@mozilla.org/network/io-service;1"]
     .getService(Components.interfaces.nsIIOService);
-var gAllMetaRegexp = new RegExp(
-    '^(\u00EF\u00BB\u00BF)?// ==UserScript==([\\s\\S]*?)^// ==/UserScript==',
-    'm');
 var gStringBundle = Components
     .classes["@mozilla.org/intl/stringbundle;1"]
     .getService(Components.interfaces.nsIStringBundleService)
     .createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
 
-
-/** Get just the stuff between ==UserScript== lines. */
-function extractMeta(aSource) {
-  var meta = aSource.match(gAllMetaRegexp);
-  if (meta) return meta[2].replace(/^\s+/, '');
-  return '';
-}
-
-
 /** Parse the source of a script; produce Script object. */
 function parse(aSource, aUri, aFailWhenMissing, aNoMetaOk) {
   var meta = extractMeta(aSource).match(/.+/g);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list