forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
483 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
var c = require("./b/c"); | ||
var c = require('./b/c'); | ||
|
||
common.debug("load fixtures/a.js"); | ||
common.debug('load fixtures/a.js'); | ||
|
||
var string = "A"; | ||
var string = 'A'; | ||
|
||
exports.SomeClass = c.SomeClass; | ||
|
||
exports.A = function () { | ||
exports.A = function() { | ||
return string; | ||
}; | ||
|
||
exports.C = function () { | ||
exports.C = function() { | ||
return c.C(); | ||
}; | ||
|
||
exports.D = function () { | ||
exports.D = function() { | ||
return c.D(); | ||
}; | ||
|
||
exports.number = 42; | ||
|
||
process.addListener("exit", function () { | ||
string = "A done"; | ||
process.addListener('exit', function() { | ||
string = 'A done'; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
var d = require("./d"); | ||
var d = require('./d'); | ||
|
||
var assert = require("assert"); | ||
var assert = require('assert'); | ||
|
||
var package = require("./package"); | ||
var package = require('./package'); | ||
|
||
assert.equal("world", package.hello); | ||
assert.equal('world', package.hello); | ||
|
||
common.debug("load fixtures/b/c.js"); | ||
common.debug('load fixtures/b/c.js'); | ||
|
||
var string = "C"; | ||
var string = 'C'; | ||
|
||
exports.SomeClass = function() { | ||
|
||
}; | ||
|
||
exports.C = function () { | ||
exports.C = function() { | ||
return string; | ||
}; | ||
|
||
exports.D = function () { | ||
exports.D = function() { | ||
return d.D(); | ||
}; | ||
|
||
process.addListener("exit", function () { | ||
string = "C done"; | ||
console.log("b/c.js exit"); | ||
process.addListener('exit', function() { | ||
string = 'C done'; | ||
console.log('b/c.js exit'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
common.debug("load fixtures/b/d.js"); | ||
common.debug('load fixtures/b/d.js'); | ||
|
||
var string = "D"; | ||
var string = 'D'; | ||
|
||
exports.D = function () { | ||
exports.D = function() { | ||
return string; | ||
}; | ||
|
||
process.addListener("exit", function () { | ||
string = "D done"; | ||
process.addListener('exit', function() { | ||
string = 'D done'; | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
exports.hello = "world"; | ||
common.debug("load package/index.js"); | ||
exports.hello = 'world'; | ||
common.debug('load package/index.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var exec = require('child_process').exec; | ||
|
||
[0, 1].forEach(function(i) { | ||
exec('ls', function(err, stdout, stderr) { | ||
console.log(i); | ||
throw new Error('hello world'); | ||
}); | ||
exec('ls', function(err, stdout, stderr) { | ||
console.log(i); | ||
throw new Error('hello world'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
var root = require("./../root"); | ||
var root = require('./../root'); | ||
|
||
exports.hello = function () { | ||
exports.hello = function() { | ||
return root.calledFromFoo(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
var foo = exports.foo = require("./folder/foo"); | ||
var foo = exports.foo = require('./folder/foo'); | ||
|
||
exports.hello = "hello"; | ||
exports.sayHello = function () { | ||
exports.hello = 'hello'; | ||
exports.sayHello = function() { | ||
return foo.hello(); | ||
}; | ||
exports.calledFromFoo = function () { | ||
exports.calledFromFoo = function() { | ||
return exports.hello; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
common = require("../common"); | ||
common = require('../common'); | ||
assert = common.assert; | ||
|
||
common.print("hello world\r\n"); | ||
common.print('hello world\r\n'); | ||
|
||
var stdin = process.openStdin(); | ||
|
||
stdin.addListener("data", function (data) { | ||
stdin.addListener('data', function(data) { | ||
process.stdout.write(data.toString()); | ||
}); | ||
|
||
stdin.addListener("end", function () { | ||
stdin.addListener('end', function() { | ||
process.stdout.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
foo = "foo"; | ||
global.bar = "bar"; | ||
foo = 'foo'; | ||
global.bar = 'bar'; | ||
|
||
exports.fooBar = {foo: global.foo, bar:bar}; | ||
exports.fooBar = {foo: global.foo, bar: bar}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
exports.hello = "hello from one!"; | ||
exports.hello = 'hello from one!'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
exports.hello = "hello from two!"; | ||
exports.hello = 'hello from two!'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
process.mixin(require("../common")); | ||
net = require("net"); | ||
process.mixin(require('../common')); | ||
net = require('net'); | ||
|
||
path = process.ARGV[2]; | ||
greeting = process.ARGV[3]; | ||
|
||
receiver = net.createServer(function(socket) { | ||
socket.addListener("fd", function(fd) { | ||
socket.addListener('fd', function(fd) { | ||
var peerInfo = process.getpeername(fd); | ||
peerInfo.fd = fd; | ||
var passedSocket = new net.Socket(peerInfo); | ||
|
||
passedSocket.addListener("eof", function() { | ||
passedSocket.addListener('eof', function() { | ||
passedSocket.close(); | ||
}); | ||
|
||
passedSocket.addListener("data", function(data) { | ||
passedSocket.send("[echo] " + data); | ||
passedSocket.addListener('data', function(data) { | ||
passedSocket.send('[echo] ' + data); | ||
}); | ||
passedSocket.addListener("close", function() { | ||
passedSocket.addListener('close', function() { | ||
receiver.close(); | ||
}); | ||
passedSocket.send("[greeting] " + greeting); | ||
passedSocket.send('[greeting] ' + greeting); | ||
}); | ||
}); | ||
|
||
/* To signal the test runne we're up and listening */ | ||
receiver.addListener("listening", function() { | ||
common.print("ready"); | ||
receiver.addListener('listening', function() { | ||
common.print('ready'); | ||
}); | ||
|
||
receiver.listen(path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
common = require("../common"); | ||
assert = common.assert | ||
Buffer = require("buffer").Buffer; | ||
common = require('../common'); | ||
assert = common.assert; | ||
Buffer = require('buffer').Buffer; | ||
|
||
var n = parseInt(process.argv[2]); | ||
|
||
b = new Buffer(n); | ||
for (var i = 0; i < n; i++) { b[i] = 100; } | ||
for (var i = 0; i < n; i++) { | ||
b[i] = 100; | ||
} | ||
|
||
process.stdout.write(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var path = require("path"); | ||
var path = require('path'); | ||
|
||
require.paths.unshift(path.join(__dirname,"../p2")); | ||
require.paths.unshift(path.join(__dirname, '../p2')); | ||
|
||
exports.foo = require("foo"); | ||
exports.foo = require('foo'); | ||
|
||
exports.expect = require(path.join(__dirname, "../p2/bar")); | ||
exports.expect = require(path.join(__dirname, '../p2/bar')); | ||
exports.actual = exports.foo.bar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require.paths.unshift(__dirname); | ||
exports.bar = require("bar"); | ||
exports.bar = require('bar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require.paths.unshift(__dirname); | ||
exports.bar = require("bar"); // surprise! this is not /p2/bar, this is /p1/bar | ||
exports.bar = require('bar'); // surprise! this is not /p2/bar, this is /p1/bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
function tmp() {} | ||
process.addListener("SIGINT", tmp); | ||
process.removeListener("SIGINT", tmp); | ||
setInterval(function () { | ||
process.addListener('SIGINT', tmp); | ||
process.removeListener('SIGINT', tmp); | ||
setInterval(function() { | ||
process.stdout.write('keep alive\n'); | ||
}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
throw new Error("blah"); | ||
throw new Error('blah'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
throw new Error("blah"); | ||
throw new Error('blah'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
process.nextTick(function () { | ||
process.nextTick(function() { | ||
JSON.parse(undefined); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
common = require("../common"); | ||
assert = common.assert | ||
common = require('../common'); | ||
assert = common.assert; | ||
|
||
util = require('util'); | ||
console.log([ | ||
'_______________________________________________50', | ||
'______________________________________________100', | ||
'______________________________________________150', | ||
'______________________________________________200', | ||
'______________________________________________250', | ||
'______________________________________________300', | ||
'______________________________________________350', | ||
'______________________________________________400', | ||
'______________________________________________450', | ||
'______________________________________________500', | ||
'______________________________________________550', | ||
'______________________________________________600', | ||
'______________________________________________650', | ||
'______________________________________________700', | ||
'______________________________________________750', | ||
'______________________________________________800', | ||
'______________________________________________850', | ||
'______________________________________________900', | ||
'______________________________________________950', | ||
'_____________________________________________1000', | ||
'_____________________________________________1050', | ||
'_____________________________________________1100', | ||
'_____________________________________________1150', | ||
'_____________________________________________1200', | ||
'_____________________________________________1250', | ||
'_____________________________________________1300', | ||
'_____________________________________________1350', | ||
'_____________________________________________1400', | ||
'_____________________________________________1450', | ||
'_____________________________________________1500', | ||
'_____________________________________________1550', | ||
'_____________________________________________1600', | ||
'_____________________________________________1650', | ||
'_____________________________________________1700', | ||
'_____________________________________________1750', | ||
'_____________________________________________1800', | ||
'_____________________________________________1850', | ||
'_____________________________________________1900', | ||
'_____________________________________________1950', | ||
'_____________________________________________2000', | ||
'_____________________________________________2050', | ||
'_____________________________________________2100', | ||
'_______________________________________________50', | ||
'______________________________________________100', | ||
'______________________________________________150', | ||
'______________________________________________200', | ||
'______________________________________________250', | ||
'______________________________________________300', | ||
'______________________________________________350', | ||
'______________________________________________400', | ||
'______________________________________________450', | ||
'______________________________________________500', | ||
'______________________________________________550', | ||
'______________________________________________600', | ||
'______________________________________________650', | ||
'______________________________________________700', | ||
'______________________________________________750', | ||
'______________________________________________800', | ||
'______________________________________________850', | ||
'______________________________________________900', | ||
'______________________________________________950', | ||
'_____________________________________________1000', | ||
'_____________________________________________1050', | ||
'_____________________________________________1100', | ||
'_____________________________________________1150', | ||
'_____________________________________________1200', | ||
'_____________________________________________1250', | ||
'_____________________________________________1300', | ||
'_____________________________________________1350', | ||
'_____________________________________________1400', | ||
'_____________________________________________1450', | ||
'_____________________________________________1500', | ||
'_____________________________________________1550', | ||
'_____________________________________________1600', | ||
'_____________________________________________1650', | ||
'_____________________________________________1700', | ||
'_____________________________________________1750', | ||
'_____________________________________________1800', | ||
'_____________________________________________1850', | ||
'_____________________________________________1900', | ||
'_____________________________________________1950', | ||
'_____________________________________________2000', | ||
'_____________________________________________2050', | ||
'_____________________________________________2100' | ||
].join('\n')); | ||
|
Oops, something went wrong.