From 5bd3cefdbe85a3af9e3ccd54e7c1985985eed4c1 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 11 Dec 2011 02:07:23 -0800 Subject: [PATCH 1/3] Cakefile: invoke --- Cakefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Cakefile b/Cakefile index 569b989f5..57524dd33 100644 --- a/Cakefile +++ b/Cakefile @@ -76,17 +76,14 @@ HEADER = """ INFILE = 'script.coffee' OUTFILE = '4chan_x.user.js' -build = -> +task 'build', -> exec 'coffee --print script.coffee', (err, stdout, stderr) -> throw err if err fs.writeFile OUTFILE, HEADER + stdout, (err) -> throw err if err -task 'build', -> - build() - task 'dev', -> - build() + invoke 'build' fs.watchFile INFILE, interval: 250, (curr, prev) -> if curr.mtime > prev.mtime build() From df9af7f162af058640c18f83556f3eaf61558289 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 11 Dec 2011 02:07:45 -0800 Subject: [PATCH 2/3] console.log.bind --- 4chan_x.user.js | 6 +----- script.coffee | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index cbd16d96a..c91612126 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -171,11 +171,7 @@ } }; - if (typeof console !== "undefined" && console !== null) { - log = function(arg) { - return console.log(arg); - }; - } + log = console.log.bind(console); if (!Object.keys) { Object.keys = function(o) { diff --git a/script.coffee b/script.coffee index bde48d9b9..1da59c13f 100644 --- a/script.coffee +++ b/script.coffee @@ -99,10 +99,7 @@ config = 'Interval': 30 # XXX chrome can't into `{log} = console` -if console? - # XXX scriptish - console.log.apply is not a function - log = (arg) -> - console.log arg +log = console.log.bind console # XXX opera cannot into Object.keys if not Object.keys From 0c1ed9e26145b0b90103846d3c8ab170faa807cb Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 11 Dec 2011 02:14:29 -0800 Subject: [PATCH 3/3] i suck --- Cakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cakefile b/Cakefile index 57524dd33..db7715a1b 100644 --- a/Cakefile +++ b/Cakefile @@ -86,4 +86,4 @@ task 'dev', -> invoke 'build' fs.watchFile INFILE, interval: 250, (curr, prev) -> if curr.mtime > prev.mtime - build() + invoke 'build'