Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11f85a1

Browse files
committed
remove console.log
1 parent f888f25 commit 11f85a1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ var CSInterface = /** @class */ (function (_super) {
3636
case 'undefined':
3737
return '"null"';
3838
case 'string':
39-
return JSON.stringify(value);
39+
var str = JSON.stringify(value);
40+
if (str.substr(0, 1) !== '"' || str.substr(-1) !== '"') {
41+
throw TypeError("Unbekannter JSON String: \"" + str + "\"");
42+
}
43+
return "\"\\" + str.substr(0, str.length - 1) + "\\\"\"";
4044
case 'number': {
4145
if (Number.isNaN(value) || Infinity === value) {
4246
return 0;
@@ -53,7 +57,7 @@ var CSInterface = /** @class */ (function (_super) {
5357
return value;
5458
}
5559
default:
56-
throw Error("Nicht unterst\u00FCtzter Typ \"" + typeof value + "\"");
60+
throw TypeError("Nicht unterst\u00FCtzter Typ \"" + typeof value + "\"");
5761
}
5862
}
5963
var args = Array.from(arguments);

src/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ class CSInterface extends CSInterfaceBase {
9595
} catch(e) {
9696
'{"error": "' + e.name + '", "message": "' + e.message.replace(/"/g, \"'\") + '", "line": "' + (e.line ? e.line - 1: -1) + '", "stack": "' + (e.stack ? e.stack.replace(/"/g, \"'\") : \"\") + '"}'
9797
}`;
98-
99-
console.debug(script);
10098
super.evalScript(script, (result: any) => {
10199

102100
// Wenn der Nutzer eine eigene Callback angegeben hat (evalScript legacy support)

0 commit comments

Comments
 (0)