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

Commit 83d2df3

Browse files
author
Ian Halliday
committed
jslint: fix jslint errors after merge
1 parent 02443ad commit 83d2df3

File tree

7 files changed

+61
-50
lines changed

7 files changed

+61
-50
lines changed

deps/chakrashim/lib/chakra_debug.js

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
Debug.setBreakPoint = function(func, line, column) {
9898
Logger.LogAPI(`Debug.setBreakPoint(${func},${line},${column})`);
9999
var funcInfo = CallHostFunction(chakraDebug.JsDiagGetFunctionPosition,
100-
func);
100+
func);
101101
var bpId = -1;
102102

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

152152
var childProperties = CallHostFunction(chakraDebug.JsDiagGetProperties,
153-
objectHandle, 0, 1000);
153+
objectHandle, 0, 1000);
154154

155155
var propertiesArray = [];
156156
['properties', 'debuggerOnlyProperties'].forEach(
@@ -288,8 +288,8 @@
288288
}
289289
} catch (ex) {
290290
Logger.LogError('ProcessPendingBreakpoints exception: ' +
291-
ex.message,
292-
ex.stack);
291+
ex.message,
292+
ex.stack);
293293
}
294294
}
295295
Array.prototype.push.apply(_pendingBreakpoints, unResolvedBreakpoints);
@@ -417,7 +417,7 @@
417417
ExecutionState.prototype.GetObjectProtoEvalHandle = function() {
418418
if (!this.objectProtoEval) {
419419
var objEval = CallHostFunction(chakraDebug.JsDiagEvaluate,
420-
'Object.__proto__', 0);
420+
'Object.__proto__', 0);
421421
if (!objEval[0]) {
422422
Logger.LogError('Evaluating Object.__proto__ failed');
423423
}
@@ -429,7 +429,7 @@
429429
ExecutionState.prototype.GetObjectPrototypeEvalHandle = function() {
430430
if (!this.objectPrototypeEval) {
431431
var objEval = CallHostFunction(chakraDebug.JsDiagEvaluate,
432-
'Object.prototype', 0);
432+
'Object.prototype', 0);
433433
if (!objEval[0]) {
434434
Logger.LogError('Evaluating Object.prototype failed');
435435
}
@@ -539,7 +539,7 @@
539539

540540
V8Frame.prototype.Evaluate = function(expression) {
541541
return CallHostFunction(chakraDebug.JsDiagEvaluate, expression,
542-
this.frame.index);
542+
this.frame.index);
543543
};
544544

545545

@@ -564,7 +564,8 @@
564564
V8Breakpoint.prototype.Set = function() {
565565
// {"breakpointId":1,"line":2,"column":4,"scriptId":1,"parentScriptId":2}
566566
var bpObject = CallHostFunction(chakraDebug.JsDiagSetBreakpoint,
567-
this.scriptObject.GetId(), this.line, this.column);
567+
this.scriptObject.GetId(),
568+
this.line, this.column);
568569
if (!bpObject) {
569570
return false;
570571
}
@@ -680,7 +681,8 @@
680681
};
681682

682683
V8CommandProcessor.prototype.source = function(request, response) {
683-
var chakraSourceObj = CallHostFunctionNoLog(chakraDebug.JsDiagGetSource,
684+
var chakraSourceObj = CallHostFunctionNoLog(
685+
chakraDebug.JsDiagGetSource,
684686
globalExecutionState.GetBreakScriptId());
685687
response.success = true;
686688
response.body = {};
@@ -724,7 +726,7 @@
724726
}
725727

726728
if (!CallHostFunction(chakraDebug.JsDiagSetStepType,
727-
jsDiagSetStepType)) {
729+
jsDiagSetStepType)) {
728730
success = false;
729731
}
730732
}
@@ -858,7 +860,7 @@
858860
}
859861
} else {
860862
handleObject = CallHostFunction(chakraDebug.JsDiagGetObjectFromHandle,
861-
handle);
863+
handle);
862864
if (handleObject) {
863865
AddChildrens(handleObject);
864866
}
@@ -952,7 +954,7 @@
952954
}
953955

954956
var success = CallHostFunction(chakraDebug.JsDiagSetBreakOnException,
955-
breakOnExceptionAttribute);
957+
breakOnExceptionAttribute);
956958
response.success = success ? true : false;
957959

958960
response.body = {};
@@ -996,8 +998,10 @@
996998

997999
//var scopesMap = { 'locals': 1, 'globals': 0, 'scopes': 3 };
9981000
if (locals.length > 0) {
999-
var scopeAndRef = DebugManager.Utility.CreateScopeAndRef(1, locals,
1000-
frameIndex, request.arguments.frame_index);
1001+
var scopeAndRef =
1002+
DebugManager.Utility.CreateScopeAndRef(
1003+
1, locals,
1004+
frameIndex, request.arguments.frame_index);
10011005
scopes.push(scopeAndRef.scope);
10021006
refs.push(scopeAndRef.ref);
10031007
}
@@ -1019,16 +1023,17 @@
10191023
});
10201024

10211025
if (allScopeProperties.length > 0) {
1022-
var allScopeAndRef = DebugManager.Utility.CreateScopeAndRef(3,
1023-
allScopeProperties, frameIndex, request.arguments.frame_index);
1026+
var allScopeAndRef =
1027+
DebugManager.Utility.CreateScopeAndRef(
1028+
3, allScopeProperties, frameIndex, request.arguments.frame_index);
10241029
scopes.push(allScopeAndRef.scope);
10251030
refs.push(allScopeAndRef.ref);
10261031
}
10271032
}
10281033

10291034
if (props['globals'] && props['globals'].handle) {
10301035
var globalsProps = CallHostFunction(chakraDebug.JsDiagGetProperties,
1031-
props['globals'].handle, 0, 5000);
1036+
props['globals'].handle, 0, 5000);
10321037

10331038
var globalProperties = [];
10341039
globalsProps['properties'].map(function(glbProperty) {
@@ -1038,8 +1043,9 @@
10381043
globalProperties.push(glbDbgProp);
10391044
});
10401045
if (globalProperties.length > 0) {
1041-
var glbScopeAndRef = DebugManager.Utility.CreateScopeAndRef(0,
1042-
globalProperties, frameIndex, request.arguments.frame_index);
1046+
var glbScopeAndRef =
1047+
DebugManager.Utility.CreateScopeAndRef(
1048+
0, globalProperties, frameIndex, request.arguments.frame_index);
10431049
scopes.push(glbScopeAndRef.scope);
10441050
refs.push(glbScopeAndRef.ref);
10451051
}

deps/chakrashim/lib/chakra_shim.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@
211211

212212
function captureStackTrace(err, func) {
213213
// skip 3 frames: lambda, withStackTraceLimitOffset, this frame
214-
return privateCaptureStackTrace(err, func,
214+
return privateCaptureStackTrace(
215+
err, func,
215216
withStackTraceLimitOffset(3, () => new BuiltInError()),
216217
3);
217218
}
@@ -308,7 +309,7 @@
308309

309310
Function.prototype.toString = function toString() {
310311
return Reflect_apply(Function_prototype_toString,
311-
typeToNative.get(this) || this, arguments);
312+
typeToNative.get(this) || this, arguments);
312313
};
313314
typeToNative.set(Function.prototype.toString, Function_prototype_toString);
314315
}

test/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ exports.nodeProcessAborted = function nodeProcessAborted(exitCode, signal) {
560560
};
561561

562562
exports.engineSpecificMessage = function(messageObject) {
563-
var jsEngine = process.jsEngine || 'v8'; //default is 'v8'
563+
const jsEngine = process.jsEngine || 'v8'; //default is 'v8'
564564
return messageObject[jsEngine];
565565
};
566566

test/parallel/test-intl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ if (!common.hasIntl) {
8686
const localeString = date0.toLocaleString(['en'], optsGMT);
8787
assert.strictEqual(localeString, common.engineSpecificMessage({
8888
v8: '1/1/1970, 12:00:00 AM',
89-
chakracore: '\u200E1\u200E/\u200E1\u200E/\u200E1970\u200E '
90-
+ '\u200E12\u200E:\u200E00\u200E:\u200E00\u200E \u200EAM'
89+
chakracore: '\u200E1\u200E/\u200E1\u200E/\u200E1970\u200E ' +
90+
'\u200E12\u200E:\u200E00\u200E:\u200E00\u200E \u200EAM'
9191
}));
9292
}
9393
// number format

test/parallel/test-vm-debug-context.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ assert.throws(function() {
2323
vm.runInDebugContext('throw URIError("BAM")');
2424
}, /URIError/);
2525

26-
assert.throws(function() {
27-
vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })');
28-
},
29-
common.engineSpecificMessage({
30-
v8: /RangeError/,
31-
chakracore: /Error: Out of stack space/
32-
}));
26+
assert.throws(
27+
function() {
28+
vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })');
29+
},
30+
common.engineSpecificMessage({
31+
v8: /RangeError/,
32+
chakracore: /Error: Out of stack space/
33+
}));
3334

3435
assert.strictEqual(typeof vm.runInDebugContext('this'), 'object');
3536
assert.strictEqual(typeof vm.runInDebugContext('Debug'), 'object');

test/parallel/test-vm-new-script-new-context.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ assert.throws(function() {
2222

2323
console.error('undefined reference');
2424
script = new Script('foo.bar = 5;');
25-
assert.throws(function() {
26-
script.runInNewContext();
27-
},
28-
common.engineSpecificMessage({
29-
v8: /not defined/,
30-
chakracore: /undefined or null/
31-
}));
25+
assert.throws(
26+
function() {
27+
script.runInNewContext();
28+
},
29+
common.engineSpecificMessage({
30+
v8: /not defined/,
31+
chakracore: /undefined or null/
32+
}));
3233

3334
global.hello = 5;
3435
script = new Script('hello = 2');
@@ -62,13 +63,14 @@ const f = { a: 1 };
6263
script.runInNewContext({ f: f });
6364
assert.strictEqual(f.a, 2);
6465

65-
assert.throws(function() {
66-
script.runInNewContext();
67-
},
68-
common.engineSpecificMessage({
69-
v8: /f is not defined/,
70-
chakracore: /'a' of undefined or null/
71-
}));
66+
assert.throws(
67+
function() {
68+
script.runInNewContext();
69+
},
70+
common.engineSpecificMessage({
71+
v8: /f is not defined/,
72+
chakracore: /'a' of undefined or null/
73+
}));
7274

7375
console.error('invalid this');
7476
assert.throws(function() {

test/sequential/test-module-loading.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ assert.throws(
7373
function() {
7474
require('../fixtures/packages/invalid');
7575
},
76-
common.engineSpecificMessage(
77-
{
78-
v8: /^SyntaxError: Error parsing \S+: Unexpected token , in JSON at position 1$/,
79-
chakraCore: /^SyntaxError: Error parsing \S+: JSON.parse Error: Invalid character at position:2$/
80-
}
76+
new RegExp(
77+
'^SyntaxError: Error parsing \\S+: ' +
78+
common.engineSpecificMessage({
79+
v8: 'Unexpected token , in JSON at position 1$',
80+
chakraCore: 'JSON.parse Error: Invalid character at position:2$'
81+
})
8182
)
8283
);
8384

0 commit comments

Comments
 (0)