[Pkg-mozext-commits] [adblock-plus] 40/464: improven der thinken

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:00 UTC 2014


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

taffit pushed a commit to branch master
in repository adblock-plus.

commit f43a11d17a497bfde5449c86c4f6ef0e1efb17cf
Author: Andrew Sutherland <asutherland at asutherland.org>
Date:   Mon Jun 29 15:37:23 2009 -0700

    improven der thinken
    
    --HG--
    extra : transplant_source : %88%9E%7E%054%EB%1C%A3%CE%02%5D%7C%DA%EE%27%2Cq6%C7j
---
 utils/comments.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/comments.js b/utils/comments.js
index 351376b..376086f 100644
--- a/utils/comments.js
+++ b/utils/comments.js
@@ -4,6 +4,8 @@
 function associate_comments(filename, scopeObject) {
   // Read the script and give us line stuff
   let file = read_file(filename).split(/\r\n|[\r\n]/);
+  // make file 1-based to avoid off-by-one errors...
+  file.unshift("");
 
   // Now, get us a sorted list of all important AST locations
   let locations = [{loc: {line: 0, column: -1}}];
@@ -68,11 +70,11 @@ function associate_comments(filename, scopeObject) {
 let comment_regex = /\/\*[\s\S]*?\*\/|\/\/.*?\n/mg;
 function find_comments(start, end, file) {
   let lines = [];
-  lines[0] = file[start.line].substr(start.column + 1).trim();
+  lines[0] = file[start.line].substring(start.column + 1).trim();
   for (let l = start.line + 1; l < end.line; l++) {
     lines.push(file[l].trim());
   }
-  lines.push(file[end.line].substr(0, end.column).trim());
+  lines.push(file[end.line].substring(0, end.column).trim());
 
   let goop = lines.join("\n");
   let match;

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



More information about the Pkg-mozext-commits mailing list