Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
jslint: fix jslint errors after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Halliday committed Feb 16, 2017
1 parent 02443ad commit 83d2df3
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 50 deletions.
44 changes: 25 additions & 19 deletions deps/chakrashim/lib/chakra_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
Debug.setBreakPoint = function(func, line, column) {
Logger.LogAPI(`Debug.setBreakPoint(${func},${line},${column})`);
var funcInfo = CallHostFunction(chakraDebug.JsDiagGetFunctionPosition,
func);
func);
var bpId = -1;

if (funcInfo.scriptId >= 0) {
Expand Down Expand Up @@ -150,7 +150,7 @@
var objectHandle = obj['handle'];

var childProperties = CallHostFunction(chakraDebug.JsDiagGetProperties,
objectHandle, 0, 1000);
objectHandle, 0, 1000);

var propertiesArray = [];
['properties', 'debuggerOnlyProperties'].forEach(
Expand Down Expand Up @@ -288,8 +288,8 @@
}
} catch (ex) {
Logger.LogError('ProcessPendingBreakpoints exception: ' +
ex.message,
ex.stack);
ex.message,
ex.stack);
}
}
Array.prototype.push.apply(_pendingBreakpoints, unResolvedBreakpoints);
Expand Down Expand Up @@ -417,7 +417,7 @@
ExecutionState.prototype.GetObjectProtoEvalHandle = function() {
if (!this.objectProtoEval) {
var objEval = CallHostFunction(chakraDebug.JsDiagEvaluate,
'Object.__proto__', 0);
'Object.__proto__', 0);
if (!objEval[0]) {
Logger.LogError('Evaluating Object.__proto__ failed');
}
Expand All @@ -429,7 +429,7 @@
ExecutionState.prototype.GetObjectPrototypeEvalHandle = function() {
if (!this.objectPrototypeEval) {
var objEval = CallHostFunction(chakraDebug.JsDiagEvaluate,
'Object.prototype', 0);
'Object.prototype', 0);
if (!objEval[0]) {
Logger.LogError('Evaluating Object.prototype failed');
}
Expand Down Expand Up @@ -539,7 +539,7 @@

V8Frame.prototype.Evaluate = function(expression) {
return CallHostFunction(chakraDebug.JsDiagEvaluate, expression,
this.frame.index);
this.frame.index);
};


Expand All @@ -564,7 +564,8 @@
V8Breakpoint.prototype.Set = function() {
// {"breakpointId":1,"line":2,"column":4,"scriptId":1,"parentScriptId":2}
var bpObject = CallHostFunction(chakraDebug.JsDiagSetBreakpoint,
this.scriptObject.GetId(), this.line, this.column);
this.scriptObject.GetId(),
this.line, this.column);
if (!bpObject) {
return false;
}
Expand Down Expand Up @@ -680,7 +681,8 @@
};

V8CommandProcessor.prototype.source = function(request, response) {
var chakraSourceObj = CallHostFunctionNoLog(chakraDebug.JsDiagGetSource,
var chakraSourceObj = CallHostFunctionNoLog(
chakraDebug.JsDiagGetSource,
globalExecutionState.GetBreakScriptId());
response.success = true;
response.body = {};
Expand Down Expand Up @@ -724,7 +726,7 @@
}

if (!CallHostFunction(chakraDebug.JsDiagSetStepType,
jsDiagSetStepType)) {
jsDiagSetStepType)) {
success = false;
}
}
Expand Down Expand Up @@ -858,7 +860,7 @@
}
} else {
handleObject = CallHostFunction(chakraDebug.JsDiagGetObjectFromHandle,
handle);
handle);
if (handleObject) {
AddChildrens(handleObject);
}
Expand Down Expand Up @@ -952,7 +954,7 @@
}

var success = CallHostFunction(chakraDebug.JsDiagSetBreakOnException,
breakOnExceptionAttribute);
breakOnExceptionAttribute);
response.success = success ? true : false;

response.body = {};
Expand Down Expand Up @@ -996,8 +998,10 @@

//var scopesMap = { 'locals': 1, 'globals': 0, 'scopes': 3 };
if (locals.length > 0) {
var scopeAndRef = DebugManager.Utility.CreateScopeAndRef(1, locals,
frameIndex, request.arguments.frame_index);
var scopeAndRef =
DebugManager.Utility.CreateScopeAndRef(
1, locals,
frameIndex, request.arguments.frame_index);
scopes.push(scopeAndRef.scope);
refs.push(scopeAndRef.ref);
}
Expand All @@ -1019,16 +1023,17 @@
});

if (allScopeProperties.length > 0) {
var allScopeAndRef = DebugManager.Utility.CreateScopeAndRef(3,
allScopeProperties, frameIndex, request.arguments.frame_index);
var allScopeAndRef =
DebugManager.Utility.CreateScopeAndRef(
3, allScopeProperties, frameIndex, request.arguments.frame_index);
scopes.push(allScopeAndRef.scope);
refs.push(allScopeAndRef.ref);
}
}

if (props['globals'] && props['globals'].handle) {
var globalsProps = CallHostFunction(chakraDebug.JsDiagGetProperties,
props['globals'].handle, 0, 5000);
props['globals'].handle, 0, 5000);

var globalProperties = [];
globalsProps['properties'].map(function(glbProperty) {
Expand All @@ -1038,8 +1043,9 @@
globalProperties.push(glbDbgProp);
});
if (globalProperties.length > 0) {
var glbScopeAndRef = DebugManager.Utility.CreateScopeAndRef(0,
globalProperties, frameIndex, request.arguments.frame_index);
var glbScopeAndRef =
DebugManager.Utility.CreateScopeAndRef(
0, globalProperties, frameIndex, request.arguments.frame_index);
scopes.push(glbScopeAndRef.scope);
refs.push(glbScopeAndRef.ref);
}
Expand Down
5 changes: 3 additions & 2 deletions deps/chakrashim/lib/chakra_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@

function captureStackTrace(err, func) {
// skip 3 frames: lambda, withStackTraceLimitOffset, this frame
return privateCaptureStackTrace(err, func,
return privateCaptureStackTrace(
err, func,
withStackTraceLimitOffset(3, () => new BuiltInError()),
3);
}
Expand Down Expand Up @@ -308,7 +309,7 @@

Function.prototype.toString = function toString() {
return Reflect_apply(Function_prototype_toString,
typeToNative.get(this) || this, arguments);
typeToNative.get(this) || this, arguments);
};
typeToNative.set(Function.prototype.toString, Function_prototype_toString);
}
Expand Down
2 changes: 1 addition & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ exports.nodeProcessAborted = function nodeProcessAborted(exitCode, signal) {
};

exports.engineSpecificMessage = function(messageObject) {
var jsEngine = process.jsEngine || 'v8'; //default is 'v8'
const jsEngine = process.jsEngine || 'v8'; //default is 'v8'
return messageObject[jsEngine];
};

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ if (!common.hasIntl) {
const localeString = date0.toLocaleString(['en'], optsGMT);
assert.strictEqual(localeString, common.engineSpecificMessage({
v8: '1/1/1970, 12:00:00 AM',
chakracore: '\u200E1\u200E/\u200E1\u200E/\u200E1970\u200E '
+ '\u200E12\u200E:\u200E00\u200E:\u200E00\u200E \u200EAM'
chakracore: '\u200E1\u200E/\u200E1\u200E/\u200E1970\u200E ' +
'\u200E12\u200E:\u200E00\u200E:\u200E00\u200E \u200EAM'
}));
}
// number format
Expand Down
15 changes: 8 additions & 7 deletions test/parallel/test-vm-debug-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ assert.throws(function() {
vm.runInDebugContext('throw URIError("BAM")');
}, /URIError/);

assert.throws(function() {
vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })');
},
common.engineSpecificMessage({
v8: /RangeError/,
chakracore: /Error: Out of stack space/
}));
assert.throws(
function() {
vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })');
},
common.engineSpecificMessage({
v8: /RangeError/,
chakracore: /Error: Out of stack space/
}));

assert.strictEqual(typeof vm.runInDebugContext('this'), 'object');
assert.strictEqual(typeof vm.runInDebugContext('Debug'), 'object');
Expand Down
30 changes: 16 additions & 14 deletions test/parallel/test-vm-new-script-new-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ assert.throws(function() {

console.error('undefined reference');
script = new Script('foo.bar = 5;');
assert.throws(function() {
script.runInNewContext();
},
common.engineSpecificMessage({
v8: /not defined/,
chakracore: /undefined or null/
}));
assert.throws(
function() {
script.runInNewContext();
},
common.engineSpecificMessage({
v8: /not defined/,
chakracore: /undefined or null/
}));

global.hello = 5;
script = new Script('hello = 2');
Expand Down Expand Up @@ -62,13 +63,14 @@ const f = { a: 1 };
script.runInNewContext({ f: f });
assert.strictEqual(f.a, 2);

assert.throws(function() {
script.runInNewContext();
},
common.engineSpecificMessage({
v8: /f is not defined/,
chakracore: /'a' of undefined or null/
}));
assert.throws(
function() {
script.runInNewContext();
},
common.engineSpecificMessage({
v8: /f is not defined/,
chakracore: /'a' of undefined or null/
}));

console.error('invalid this');
assert.throws(function() {
Expand Down
11 changes: 6 additions & 5 deletions test/sequential/test-module-loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ assert.throws(
function() {
require('../fixtures/packages/invalid');
},
common.engineSpecificMessage(
{
v8: /^SyntaxError: Error parsing \S+: Unexpected token , in JSON at position 1$/,
chakraCore: /^SyntaxError: Error parsing \S+: JSON.parse Error: Invalid character at position:2$/
}
new RegExp(
'^SyntaxError: Error parsing \\S+: ' +
common.engineSpecificMessage({
v8: 'Unexpected token , in JSON at position 1$',
chakraCore: 'JSON.parse Error: Invalid character at position:2$'
})
)
);

Expand Down

0 comments on commit 83d2df3

Please sign in to comment.