Skip to content

Commit a3f86f0

Browse files
author
Benjamin Pasero
authored
Drop node.js require for bootstrap and bootstrap-window (microsoft#100857)
* sandbox - load bootstrap/bootstrap-window via script tags (workbench) * sandbox - adopt script loading for issue reporter and process explorer
1 parent 4542519 commit a3f86f0

11 files changed

Lines changed: 445 additions & 386 deletions

File tree

src/bootstrap-fork.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ function pipeLoggingToParent() {
102102
const seen = [];
103103
const argsArray = [];
104104

105-
let res;
106-
107105
// Massage some arguments with special treatment
108106
if (args.length) {
109107
for (let i = 0; i < args.length; i++) {
@@ -138,7 +136,7 @@ function pipeLoggingToParent() {
138136
}
139137

140138
try {
141-
res = JSON.stringify(argsArray, function (key, value) {
139+
const res = JSON.stringify(argsArray, function (key, value) {
142140

143141
// Objects get special treatment to prevent circles
144142
if (isObject(value) || Array.isArray(value)) {
@@ -151,15 +149,15 @@ function pipeLoggingToParent() {
151149

152150
return value;
153151
});
154-
} catch (error) {
155-
return 'Output omitted for an object that cannot be inspected (' + error.toString() + ')';
156-
}
157152

158-
if (res && res.length > MAX_LENGTH) {
159-
return 'Output omitted for a large object that exceeds the limits';
160-
}
153+
if (res.length > MAX_LENGTH) {
154+
return 'Output omitted for a large object that exceeds the limits';
155+
}
161156

162-
return res;
157+
return res;
158+
} catch (error) {
159+
return `Output omitted for an object that cannot be inspected ('${error.toString()}')`;
160+
}
163161
}
164162

165163
/**

0 commit comments

Comments
 (0)