Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2009-10-05 17:46:31 +0400
committerRyan Dahl <ry@tinyclouds.org>2009-10-05 17:46:31 +0400
commit8185e1fd2501d2d5001d254213c41002440ec7fc (patch)
tree0f899b26354464329572be87f33d0677a45007b7 /benchmark/run.js
parent522909bcbf6ff577ddf66b8c07148cf581615157 (diff)
Remove include() add node.mixin()
include() should not be used by libraries because it will pollute the global namespace. To discourage this behavior and bring Node more in-line with the current CommonJS module system, include() is removed. Small scripts like unit tests often times do want to pollute the global namespace for ease. To avoid the boiler plate code of var x = require("/x.js"); var foo = x.foo; var bar = x.bar; The function node.mixin() is stolen from jQuery's jQuery.extend. So that it can be written: node.mixin(require("/x.js")); Reference: http://docs.jquery.com/Utilities/jQuery.extend http://groups.google.com/group/nodejs/browse_thread/thread/f9ac83e5c11e7e87
Diffstat (limited to 'benchmark/run.js')
-rw-r--r--benchmark/run.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/run.js b/benchmark/run.js
index d9c26686878..869ae55a63b 100644
--- a/benchmark/run.js
+++ b/benchmark/run.js
@@ -1,6 +1,6 @@
libDir = node.path.join(node.path.dirname(__filename), "../lib");
node.libraryPaths.unshift(libDir);
-include("/utils.js");
+node.mixin(require("/utils.js"));
var benchmarks = [ "static_http_server.js"
, "timers.js"
, "process_loop.js"