Browse Source

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
v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
8185e1fd25
  1. 4
      benchmark/http_simple.js
  2. 2
      benchmark/process_loop.js
  3. 2
      benchmark/run.js
  4. 2
      bin/node-repl
  5. 48
      doc/api.txt
  6. 76
      src/node.js
  7. 10
      src/util.js
  8. 8
      test/mjsunit/common.js
  9. 2
      test/mjsunit/disabled/test-cat.js
  10. 2
      test/mjsunit/disabled/test-http-stress.js
  11. 2
      test/mjsunit/disabled/test-remote-module-loading.js
  12. 1
      test/mjsunit/disabled/test_dns.js
  13. 4
      test/mjsunit/test-buffered-file.js
  14. 2
      test/mjsunit/test-delayed-require.js
  15. 2
      test/mjsunit/test-event-emitter-add-listeners.js
  16. 2
      test/mjsunit/test-exec.js
  17. 2
      test/mjsunit/test-file-cat-noexist.js
  18. 2
      test/mjsunit/test-fs-stat.js
  19. 2
      test/mjsunit/test-fs-write.js
  20. 2
      test/mjsunit/test-http-cat.js
  21. 2
      test/mjsunit/test-http-client-race.js
  22. 2
      test/mjsunit/test-http-client-upload.js
  23. 2
      test/mjsunit/test-http-malformed-request.js
  24. 2
      test/mjsunit/test-http-proxy.js
  25. 2
      test/mjsunit/test-http-server.js
  26. 2
      test/mjsunit/test-http.js
  27. 2
      test/mjsunit/test-mkdir-rmdir.js
  28. 2
      test/mjsunit/test-module-loading.js
  29. 2
      test/mjsunit/test-multipart.js
  30. 2
      test/mjsunit/test-process-buffering.js
  31. 2
      test/mjsunit/test-process-kill.js
  32. 2
      test/mjsunit/test-process-simple.js
  33. 2
      test/mjsunit/test-process-spawn-loop.js
  34. 2
      test/mjsunit/test-promise-wait.js
  35. 2
      test/mjsunit/test-readdir.js
  36. 2
      test/mjsunit/test-tcp-binary.js
  37. 2
      test/mjsunit/test-tcp-many-clients.js
  38. 2
      test/mjsunit/test-tcp-pingpong-delay.js
  39. 2
      test/mjsunit/test-tcp-pingpong.js
  40. 2
      test/mjsunit/test-tcp-reconnect.js
  41. 2
      test/mjsunit/test-tcp-throttle-kernel-buffer.js
  42. 2
      test/mjsunit/test-tcp-throttle.js
  43. 2
      test/mjsunit/test-tcp-timeout.js
  44. 2
      test/mjsunit/test-timers.js
  45. 2
      test/mjsunit/test-utf8-scripts.js
  46. 2
      test/mjsunit/test-wait-ordering.js

4
benchmark/http_simple.js

@ -1,7 +1,7 @@
libDir = node.path.join(node.path.dirname(__filename), "../lib"); libDir = node.path.join(node.path.dirname(__filename), "../lib");
node.libraryPaths.unshift(libDir); node.libraryPaths.unshift(libDir);
include("/utils.js"); node.mixin(require("/utils.js"));
http = require("/http.js"); http = require("/http.js");
fixed = "" fixed = ""
@ -16,7 +16,7 @@ http.createServer(function (req, res) {
var arg = commands[2]; var arg = commands[2];
var status = 200; var status = 200;
//p(req.headers); p(req.uri.params);
if (command == "bytes") { if (command == "bytes") {
var n = parseInt(arg, 10) var n = parseInt(arg, 10)

2
benchmark/process_loop.js

@ -1,6 +1,6 @@
libDir = node.path.join(node.path.dirname(__filename), "../lib"); libDir = node.path.join(node.path.dirname(__filename), "../lib");
node.libraryPaths.unshift(libDir); node.libraryPaths.unshift(libDir);
include("/utils.js"); node.mixin(require("/utils.js"));
function next (i) { function next (i) {
if (i <= 0) return; if (i <= 0) return;

2
benchmark/run.js

@ -1,6 +1,6 @@
libDir = node.path.join(node.path.dirname(__filename), "../lib"); libDir = node.path.join(node.path.dirname(__filename), "../lib");
node.libraryPaths.unshift(libDir); node.libraryPaths.unshift(libDir);
include("/utils.js"); node.mixin(require("/utils.js"));
var benchmarks = [ "static_http_server.js" var benchmarks = [ "static_http_server.js"
, "timers.js" , "timers.js"
, "process_loop.js" , "process_loop.js"

2
bin/node-repl

@ -1,6 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
include("/utils.js"); node.mixin(require("/utils.js"));
puts("Welcome to the Node.js REPL."); puts("Welcome to the Node.js REPL.");
puts("Enter ECMAScript at the prompt."); puts("Enter ECMAScript at the prompt.");
puts("Tip 1: Use 'rlwrap node-repl' for a better interface"); puts("Tip 1: Use 'rlwrap node-repl' for a better interface");

48
doc/api.txt

@ -16,8 +16,8 @@ An example of a web server written with Node which responds with "Hello
World": World":
---------------------------------------- ----------------------------------------
include("/utils.js"); node.mixin(require("/utils.js"));
include("/http.js"); node.mixin(require("/http.js"));
createServer(function (request, response) { createServer(function (request, response) {
response.sendHeader(200, {"Content-Type": "text/plain"}); response.sendHeader(200, {"Content-Type": "text/plain"});
response.sendBody("Hello World\n"); response.sendBody("Hello World\n");
@ -61,11 +61,23 @@ error reporting.
The filename of the script being executed. The filename of the script being executed.
+require(path)+ :: +require(path)+ ::
+include(path)+ ::
See the modules section. See the modules section.
+node.libraryPaths+ :: +node.libraryPaths+ ::
The search path for absolute path arguments to +require()+ and +include()+. The search path for absolute path arguments to +require()+.
+node.mixin([deep], target, object1, [objectN])+ ::
Extend one object with one or more others, returning the modified object.
If no target is specified, the +process+ namespace itself is extended.
Keep in mind that the target object will be modified, and will be returned
from +node.mixin()+.
+
If a boolean true is specified as the first argument, Node performs a deep
copy, recursively copying any objects it finds. Otherwise, the copy will
share structure with the original object(s).
+
Undefined properties are not copied. However, properties inherited from the
object's prototype will be copied over.
=== The +process+ Object === The +process+ Object
@ -119,7 +131,7 @@ Executes the command as a child process, buffers the output and returns it
in a promise callback. in a promise callback.
+ +
---------------------------------------- ----------------------------------------
include("/utils.js"); node.mixin(require("/utils.js"));
exec("ls /").addCallback(function (stdout, stderr) { exec("ls /").addCallback(function (stdout, stderr) {
puts(stdout); puts(stdout);
}); });
@ -269,7 +281,7 @@ The contents of +foo.js+:
---------------------------------------- ----------------------------------------
var circle = require("circle.js"); var circle = require("circle.js");
include("/utils.js"); node.mixin(require("/utils.js"));
puts("The area of a circle of radius 4 is " + circle.area(4)); puts("The area of a circle of radius 4 is " + circle.area(4));
---------------------------------------- ----------------------------------------
@ -292,24 +304,20 @@ The module +circle.js+ has exported the functions +area()+ and
object. (Alternatively, one can use +this+ instead of +exports+.) Variables object. (Alternatively, one can use +this+ instead of +exports+.) Variables
local to the module will be private. In this example the variable +PI+ is local to the module will be private. In this example the variable +PI+ is
private to +circle.js+. The function +puts()+ comes from the module private to +circle.js+. The function +puts()+ comes from the module
+"/utils.js"+. Because +include("/utils.js")+ was called, +puts()+ is in the +"/utils.js"+.
global namespace.
The module path is relative to the file calling +require()+. That is, The module path is relative to the file calling +require()+. That is,
+circle.js+ must be in the same directory as +foo.js+ for +require()+ to +circle.js+ must be in the same directory as +foo.js+ for +require()+ to
find it. find it.
Like +require()+ the function +include()+ also loads a module. Instead of Use +node.mixin()+ to include modules into the global namespace.
returning a namespace object, +include()+ will add the module's exports into
the global namespace. For example:
---------------------------------------- ----------------------------------------
include("circle.js"); node.mixin(process, require("circle.js"), require("/utils.js"));
include("/utils.js");
puts("The area of a cirlce of radius 4 is " + area(4)); puts("The area of a cirlce of radius 4 is " + area(4));
---------------------------------------- ----------------------------------------
When an absolute path is given to +require()+ or +include()+, like When an absolute path is given to +require()+, like
+require("/mjsunit.js")+ the module is searched for in the +require("/mjsunit.js")+ the module is searched for in the
+node.libraryPaths+ array. +node.libraryPaths+ on my system looks like this: +node.libraryPaths+ array. +node.libraryPaths+ on my system looks like this:
@ -567,8 +575,7 @@ Objects returned from +node.fs.stat()+ are of this type.
=== HTTP === HTTP
To use the HTTP server and client one must +require("/http.js")+ or To use the HTTP server and client one must +require("/http.js")+.
+include("/http.js")+.
The HTTP interfaces in Node are designed to support many features The HTTP interfaces in Node are designed to support many features
of the protocol which have been traditionally difficult to use. of the protocol which have been traditionally difficult to use.
@ -990,8 +997,7 @@ stream.addListener('complete', function() {
=== TCP === TCP
To use the TCP server and client one must +require("/tcp.js")+ or To use the TCP server and client one must +require("/tcp.js")+.
+include("/tcp.js")+.
==== +tcp.Server+ ==== +tcp.Server+
@ -999,7 +1005,7 @@ Here is an example of a echo server which listens for connections
on port 7000 on port 7000
---------------------------------------- ----------------------------------------
include("/tcp.js"); node.mixin(require("/tcp.js"));
var server = createServer(function (socket) { var server = createServer(function (socket) {
socket.setEncoding("utf8"); socket.setEncoding("utf8");
socket.addListener("connect", function () { socket.addListener("connect", function () {
@ -1237,8 +1243,8 @@ result of the last expression.
The library is called +/repl.js+ and it can be used like this: The library is called +/repl.js+ and it can be used like this:
------------------------------------ ------------------------------------
include("/utils.js"); node.mixin(require("/utils.js"));
include("/tcp.js"); node.mixin(require("/tcp.js"));
nconnections = 0; nconnections = 0;
createServer(function (c) { createServer(function (c) {
error("Connection!"); error("Connection!");

76
src/node.js

@ -13,7 +13,7 @@ node.createChildProcess = function (command) {
}; };
node.exec = function () { node.exec = function () {
throw new Error("node.exec() has moved. Use include('/utils.js') to bring it back."); throw new Error("node.exec() has moved. Use require('/utils.js') to bring it back.");
} }
node.http.createServer = function () { node.http.createServer = function () {
@ -28,6 +28,61 @@ node.tcp.createConnection = function (port, host) {
throw new Error("node.tcp.createConnection() has moved. Use require('/tcp.js') to access it."); throw new Error("node.tcp.createConnection() has moved. Use require('/tcp.js') to access it.");
}; };
/* From jQuery.extend in the jQuery JavaScript Library v1.3.2
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*/
node.mixin = function() {
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !node.isFunction(target) )
target = {};
// mixin process itself if only one argument is passed
if ( length == i ) {
target = process;
--i;
}
for ( ; i < length; i++ )
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null )
// Extend the base object
for ( var name in options ) {
var src = target[ name ], copy = options[ name ];
// Prevent never-ending loop
if ( target === copy )
continue;
// Recurse if we're merging object values
if ( deep && copy && typeof copy === "object" && !copy.nodeType )
target[ name ] = node.mixin( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );
// Don't bring in undefined values
else if ( copy !== undefined )
target[ name ] = copy;
}
// Return the modified object
return target;
};
// Timers // Timers
function setTimeout (callback, after) { function setTimeout (callback, after) {
@ -207,27 +262,12 @@ node.Module.prototype.loadScript = function (loadPromise) {
return requireAsync(url).wait(); return requireAsync(url).wait();
} }
function includeAsync (url) {
var promise = requireAsync(url)
promise.addCallback(function (t) {
// copy properties into global namespace.
for (var prop in t) {
if (t.hasOwnProperty(prop)) process[prop] = t[prop];
}
});
return promise;
}
function include (url) {
includeAsync(url).wait();
}
// create wrapper function // create wrapper function
var wrapper = "function (__filename, exports, require, include) { " + content + "\n};"; var wrapper = "function (__filename, exports, require) { " + content + "\n};";
var compiled_wrapper = node.compile(wrapper, self.filename); var compiled_wrapper = node.compile(wrapper, self.filename);
node.loadingModules.unshift(self); node.loadingModules.unshift(self);
compiled_wrapper.apply(self.target, [self.filename, self.target, require, include]); compiled_wrapper.apply(self.target, [self.filename, self.target, require]);
node.loadingModules.shift(); node.loadingModules.shift();
self.waitChildrenLoad(function () { self.waitChildrenLoad(function () {

10
src/util.js

@ -70,21 +70,21 @@ node.path = new function () {
puts = function () { puts = function () {
throw new Error("puts() has moved. Use include('/utils.js') to bring it back."); throw new Error("puts() has moved. Use require('/utils.js') to bring it back.");
} }
print = function () { print = function () {
throw new Error("print() has moved. Use include('/utils.js') to bring it back."); throw new Error("print() has moved. Use require('/utils.js') to bring it back.");
} }
p = function () { p = function () {
throw new Error("p() has moved. Use include('/utils.js') to bring it back."); throw new Error("p() has moved. Use require('/utils.js') to bring it back.");
} }
node.debug = function () { node.debug = function () {
throw new Error("node.debug() has moved. Use include('/utils.js') to bring it back."); throw new Error("node.debug() has moved. Use require('/utils.js') to bring it back.");
} }
node.error = function () { node.error = function () {
throw new Error("node.error() has moved. Use include('/utils.js') to bring it back."); throw new Error("node.error() has moved. Use require('/utils.js') to bring it back.");
} }

8
test/mjsunit/common.js

@ -5,10 +5,6 @@ exports.libDir = node.path.join(exports.testDir, "../../lib");
node.libraryPaths.unshift(exports.libDir); node.libraryPaths.unshift(exports.libDir);
var mjsunit = require("/mjsunit.js"); var mjsunit = require("/mjsunit.js");
include("/utils.js"); var utils = require("/utils.js");
// Copy mjsunit namespace out node.mixin(exports, mjsunit, utils);
for (var prop in mjsunit) {
if (mjsunit.hasOwnProperty(prop)) exports[prop] = mjsunit[prop];
}

2
test/mjsunit/disabled/test-cat.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("../common.js"));
http = require("/http.js"); http = require("/http.js");
PORT = 8888; PORT = 8888;

2
test/mjsunit/disabled/test-http-stress.js

@ -1,4 +1,4 @@
include('../mjsunit.js'); node.mixin(require('../common.js'));
var PORT = 8003; var PORT = 8003;
var request_count = 1000; var request_count = 1000;

2
test/mjsunit/disabled/test-remote-module-loading.js

@ -9,7 +9,7 @@ var s = node.http.createServer(function (req, res) {
}); });
s.listen(8000); s.listen(8000);
include("mjsunit.js"); node.mixin(require("../common.js"));
var a = require("http://localhost:8000/") var a = require("http://localhost:8000/")
assertInstanceof(a.A, Function); assertInstanceof(a.A, Function);

1
test/mjsunit/disabled/test_dns.js

@ -1,3 +1,4 @@
node.mixin(require("../common.js"));
for (var i = 2; i < ARGV.length; i++) { for (var i = 2; i < ARGV.length; i++) {
var name = ARGV[i] var name = ARGV[i]
puts("looking up " + name); puts("looking up " + name);

4
test/mjsunit/test-buffered-file.js

@ -1,10 +1,10 @@
include("common.js"); node.mixin(require("common.js"));
var testTxt = node.path.join(fixturesDir, "test.txt"); var testTxt = node.path.join(fixturesDir, "test.txt");
var libDir = node.path.join(testDir, "../../lib"); var libDir = node.path.join(testDir, "../../lib");
node.libraryPaths.unshift(libDir); node.libraryPaths.unshift(libDir);
include("/file.js"); node.mixin(require("/file.js"));
var fileUnlinked = false; var fileUnlinked = false;

2
test/mjsunit/test-delayed-require.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
setTimeout(function () { setTimeout(function () {
a = require("fixtures/a.js"); a = require("fixtures/a.js");

2
test/mjsunit/test-event-emitter-add-listeners.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var e = new node.EventEmitter(); var e = new node.EventEmitter();

2
test/mjsunit/test-exec.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
success_count = 0; success_count = 0;
error_count = 0; error_count = 0;

2
test/mjsunit/test-file-cat-noexist.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var got_error = false; var got_error = false;
var filename = node.path.join(fixturesDir, "does_not_exist.txt"); var filename = node.path.join(fixturesDir, "does_not_exist.txt");

2
test/mjsunit/test-fs-stat.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var got_error = false; var got_error = false;
var success_count = 0; var success_count = 0;

2
test/mjsunit/test-fs-write.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var path = node.path.join(fixturesDir, "write.txt"); var path = node.path.join(fixturesDir, "write.txt");
var expected = "hello"; var expected = "hello";

2
test/mjsunit/test-http-cat.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
PORT = 8888; PORT = 8888;

2
test/mjsunit/test-http-client-race.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
PORT = 8888; PORT = 8888;

2
test/mjsunit/test-http-client-upload.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
var PORT = 18032; var PORT = 18032;

2
test/mjsunit/test-http-malformed-request.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
http = require("/http.js"); http = require("/http.js");

2
test/mjsunit/test-http-proxy.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
var PROXY_PORT = 8869; var PROXY_PORT = 8869;

2
test/mjsunit/test-http-server.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
http = require("/http.js"); http = require("/http.js");

2
test/mjsunit/test-http.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
PORT = 8888; PORT = 8888;

2
test/mjsunit/test-mkdir-rmdir.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var dirname = node.path.dirname(__filename); var dirname = node.path.dirname(__filename);
var fixtures = node.path.join(dirname, "fixtures"); var fixtures = node.path.join(dirname, "fixtures");

2
test/mjsunit/test-module-loading.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
debug("load test-module-loading.js"); debug("load test-module-loading.js");

2
test/mjsunit/test-multipart.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
http = require("/http.js"); http = require("/http.js");
var multipart = require('/multipart.js'); var multipart = require('/multipart.js');

2
test/mjsunit/test-process-buffering.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var pwd_called = false; var pwd_called = false;

2
test/mjsunit/test-process-kill.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var exit_status = -1; var exit_status = -1;

2
test/mjsunit/test-process-simple.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var cat = node.createChildProcess("cat"); var cat = node.createChildProcess("cat");

2
test/mjsunit/test-process-spawn-loop.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var N = 40; var N = 40;
var finished = false; var finished = false;

2
test/mjsunit/test-promise-wait.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var p1_done = false; var p1_done = false;
var p1 = new node.Promise(); var p1 = new node.Promise();

2
test/mjsunit/test-readdir.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var got_error = false; var got_error = false;

2
test/mjsunit/test-tcp-binary.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
PORT = 23123; PORT = 23123;

2
test/mjsunit/test-tcp-many-clients.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
// settings // settings
var port = 20743; var port = 20743;

2
test/mjsunit/test-tcp-pingpong-delay.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");

2
test/mjsunit/test-tcp-pingpong.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");

2
test/mjsunit/test-tcp-reconnect.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
var N = 50; var N = 50;
var port = 8921; var port = 8921;

2
test/mjsunit/test-tcp-throttle-kernel-buffer.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
PORT = 20444; PORT = 20444;
N = 30*1024; // 500kb N = 30*1024; // 500kb

2
test/mjsunit/test-tcp-throttle.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
PORT = 20443; PORT = 20443;
N = 200; N = 200;

2
test/mjsunit/test-tcp-timeout.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
tcp = require("/tcp.js"); tcp = require("/tcp.js");
port = 9992; port = 9992;
exchanges = 0; exchanges = 0;

2
test/mjsunit/test-timers.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
var WINDOW = 200; // why is does this need to be so big? var WINDOW = 200; // why is does this need to be so big?

2
test/mjsunit/test-utf8-scripts.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
// üäö // üäö

2
test/mjsunit/test-wait-ordering.js

@ -1,4 +1,4 @@
include("common.js"); node.mixin(require("common.js"));
function timer (t) { function timer (t) {
var promise = new node.Promise(); var promise = new node.Promise();

Loading…
Cancel
Save