Skip to content

Commit

Permalink
src,test: Fixed merge conflicts
Browse files Browse the repository at this point in the history
PR-URL: nodejs#192
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
  • Loading branch information
kunalspathak committed Mar 20, 2017
1 parent 08a0e89 commit b7a68b5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 54 deletions.
15 changes: 0 additions & 15 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,6 @@ static void Stat(const FunctionCallbackInfo<Value>& args) {
ASSERT_PATH(path)

if (args[1]->IsObject()) {

#if ENABLE_TTD_NODE
ab->TTDRawBufferModifyNotifySync(array->ByteOffset(),
array->Length() * sizeof(double));
#endif
ASYNC_CALL(stat, args[1], UTF8, *path)
} else {
SYNC_CALL(stat, *path, *path)
Expand All @@ -587,11 +582,6 @@ static void LStat(const FunctionCallbackInfo<Value>& args) {
ASSERT_PATH(path)

if (args[1]->IsObject()) {

#if ENABLE_TTD_NODE
ab->TTDRawBufferModifyNotifySync(array->ByteOffset(),
array->Length() * sizeof(double));
#endif
ASYNC_CALL(lstat, args[1], UTF8, *path)
} else {
SYNC_CALL(lstat, *path, *path)
Expand All @@ -611,11 +601,6 @@ static void FStat(const FunctionCallbackInfo<Value>& args) {
int fd = args[0]->Int32Value();

if (args[1]->IsObject()) {

#if ENABLE_TTD_NODE
ab->TTDRawBufferModifyNotifySync(array->ByteOffset(),
array->Length() * sizeof(double));
#endif
ASYNC_CALL(fstat, args[1], UTF8, fd)
} else {
SYNC_CALL(fstat, nullptr, fd)
Expand Down
80 changes: 41 additions & 39 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ assert.strictEqual(util.inspect({a: async () => {}}),
'{ a: [AsyncFunction: a] }');
assert.strictEqual(util.inspect({a: function*() {}}),
'{ a: [GeneratorFunction: a] }');

assert.strictEqual(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }');
assert.strictEqual(util.inspect({'a': {}}), '{ a: {} }');
assert.strictEqual(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }');
Expand Down Expand Up @@ -298,12 +297,13 @@ assert.strictEqual(

// Function with properties
{
const value = function() {};
const value = function() { };
value.aprop = 42;
assert.strictEqual(util.inspect(value), common.engineSpecificMessage({
v8: '{ [Function: value] aprop: 42 }',
chakracore: '{ [Function: value] aprop: 42 }'
}));
v8: '{ [Function: value] aprop: 42 }',
chakracore: '{ [Function: value] aprop: 42 }'
}));
}

// Anonymous function with properties
{
Expand Down Expand Up @@ -389,7 +389,8 @@ if (!common.isChakraEngine) {
assert.strictEqual(util.inspect(obj), common.engineSpecificMessage({
v8: 'Promise { <pending> }',
chakracore: 'Promise {}'
}));
}));
}

// test for property descriptors
{
Expand Down Expand Up @@ -793,7 +794,7 @@ if (typeof Symbol !== 'undefined') {
common.engineSpecificMessage({
v8: 'Promise { 3 }',
chakracore: 'Promise {}'
}));
}));

const rejected = Promise.reject(3);
assert.strictEqual(util.inspect(rejected),
Expand All @@ -809,14 +810,14 @@ if (typeof Symbol !== 'undefined') {
v8: 'Promise { <pending> }',
chakracore: 'Promise {}'
}));

const promiseWithProperty = Promise.resolve('foo');
promiseWithProperty.bar = 42;
assert.strictEqual(util.inspect(promiseWithProperty),
common.engineSpecificMessage({
v8: 'Promise { \'foo\', bar: 42 }',
chakracore: 'Promise { bar: 42 }'
}));
common.engineSpecificMessage({
v8: 'Promise { \'foo\', bar: 42 }',
chakracore: 'Promise { bar: 42 }'
}));
}


Expand All @@ -827,40 +828,41 @@ if (typeof Symbol !== 'undefined') {
const oldPromise = Promise;
global.Promise = function() { this.bar = 42; };
assert.strictEqual(util.inspect(new Promise()),
common.engineSpecificMessage({
v8: '{ bar: 42 }',
chakracore: 'Object { \'<unknown>\', bar: 42 }'
}));
common.engineSpecificMessage({
v8: '{ bar: 42 }',
chakracore: 'Object { \'<unknown>\', bar: 42 }'
}));
global.Promise = oldPromise;
}

// Skip for chakra engine as debugger support not yet present
// below code uses `Debug.MakeMirror` to inspect
if (!common.isChakraEngine) {
// Test Map iterators
{
const map = new Map([['foo', 'bar']]);
assert.strictEqual(util.inspect(map.keys()), 'MapIterator { \'foo\' }');
assert.strictEqual(util.inspect(map.values()), 'MapIterator { \'bar\' }');
assert.strictEqual(util.inspect(map.entries()),
'MapIterator { [ \'foo\', \'bar\' ] }');
// make sure the iterator doesn't get consumed
const keys = map.keys();
assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }');
assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }');
}
// Test Map iterators
{
const map = new Map([['foo', 'bar']]);
assert.strictEqual(util.inspect(map.keys()), 'MapIterator { \'foo\' }');
assert.strictEqual(util.inspect(map.values()), 'MapIterator { \'bar\' }');
assert.strictEqual(util.inspect(map.entries()),
'MapIterator { [ \'foo\', \'bar\' ] }');
// make sure the iterator doesn't get consumed
const keys = map.keys();
assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }');
assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }');
}

// Test Set iterators
{
const aSet = new Set([1, 3]);
assert.strictEqual(util.inspect(aSet.keys()), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(aSet.values()), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(aSet.entries()),
'SetIterator { [ 1, 1 ], [ 3, 3 ] }');
// make sure the iterator doesn't get consumed
const keys = aSet.keys();
assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }');
// Test Set iterators
{
const aSet = new Set([1, 3]);
assert.strictEqual(util.inspect(aSet.keys()), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(aSet.values()), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(aSet.entries()),
'SetIterator { [ 1, 1 ], [ 3, 3 ] }');
// make sure the iterator doesn't get consumed
const keys = aSet.keys();
assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }');
assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }');
}
}

// Test alignment of items in container
Expand Down

0 comments on commit b7a68b5

Please sign in to comment.