summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2012-07-01 03:11:47 -0500
committerKyle Kaminski <kyle@kkaminsk.com>2012-07-01 03:11:47 -0500
commit8263f26456dbcd7d5871fc5b394d08af8f4f63b4 (patch)
tree7c3bd8f82e707b3c273870001b37bb21258e0811
parentf052db6b797d7b2f08263ed39ced3c2095c4658d (diff)
downloadfubar-8263f26456dbcd7d5871fc5b394d08af8f4f63b4.tar.gz
fubar-8263f26456dbcd7d5871fc5b394d08af8f4f63b4.tar.bz2
fubar-8263f26456dbcd7d5871fc5b394d08af8f4f63b4.zip
it is really hard to read traces and errors
-rw-r--r--express/app1.js2
-rw-r--r--express/app2.js2
-rw-r--r--express/app3.js2
-rw-r--r--notes.txt5
-rw-r--r--samples/weird_function.js31
5 files changed, 39 insertions, 3 deletions
diff --git a/express/app1.js b/express/app1.js
index 8c25531..a9d0d2b 100644
--- a/express/app1.js
+++ b/express/app1.js
@@ -1,6 +1,6 @@
var express = require('express');
-var app = express.createServer()
+var app = express.createServer();
app.configure('dev', function() {
app.use(express.errorHandler({
diff --git a/express/app2.js b/express/app2.js
index 292741b..bd03664 100644
--- a/express/app2.js
+++ b/express/app2.js
@@ -1,7 +1,7 @@
var express = require('express');
var util = require('util');
-var app = express.createServer()
+var app = express.createServer();
var pagehits = 0;
app.configure('dev', function() {
diff --git a/express/app3.js b/express/app3.js
index 1532b28..0c2acd4 100644
--- a/express/app3.js
+++ b/express/app3.js
@@ -7,7 +7,7 @@ var express = require('express');
var util = require('util');
var RedisStore = require('connect-redis')(express);
-var app = express.createServer()
+var app = express.createServer();
var pagehits = 0;
app.configure('dev', function() {
diff --git a/notes.txt b/notes.txt
new file mode 100644
index 0000000..38da624
--- /dev/null
+++ b/notes.txt
@@ -0,0 +1,5 @@
+[express]
+$ express
+do '# npm install -g express' beforehand, express command
+generates nice template dir structure to get started
+
diff --git a/samples/weird_function.js b/samples/weird_function.js
new file mode 100644
index 0000000..d02d172
--- /dev/null
+++ b/samples/weird_function.js
@@ -0,0 +1,31 @@
+/* seems like we can assign anonymous function to an IDENTIFIER, without var in
+ * front of it. the fuck seriously
+ *
+ * this way I guess, we have hidden a function, that only identifier points to
+ */
+
+/* the fuck, why does 'var' does then if it's not needed ?
+ * http://stackoverflow.com/questions/2485423/javascript-is-using-var-to-declare-variables-optional
+ *
+ * id with var has local scope, whereas id without var wasn't prev declared, it would
+ * eventually be attached to global object, outermost scope, if it was declared, then
+ * we would be just redefining its content, duh!
+ */
+
+p = 12;
+console.log(p);
+
+foo = function(txt) {
+ this.id = 'foo';
+ console.log('hello, ' + txt);
+}
+
+foo.call(foo, 'world');
+console.log('id of foo is: ' + foo.id);
+
+var bar = foo; /* this is just a reference */
+bar.call(bar, 'world');
+bar.id = 'bar';
+console.log('id of bar is: ' + bar.id);
+console.log('id of foo is: ' + foo.id);
+