style: 简化loader 避免全局error
This commit is contained in:
1 parent
b25f9d3bec
commit
96de9e2c16
3 files changed
+17
-43
No files matched your search
@@ -63,31 +63,11 @@ export class WindowsPtyAgent {
|
||||
}
|
||||
if (this._useConpty) {
|
||||
if (!conptyNative) {
|
||||
try {
|
||||
conptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/conpty.node');
|
||||
} catch (outerError) {
|
||||
try {
|
||||
conptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/conpty.node');
|
||||
} catch (innerError) {
|
||||
console.error('innerError', innerError);
|
||||
// Re-throw the exception from the Release require if the Debug require fails as well
|
||||
throw outerError;
|
||||
}
|
||||
}
|
||||
conptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/conpty.node');
|
||||
}
|
||||
} else {
|
||||
if (!winptyNative) {
|
||||
try {
|
||||
winptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/pty.node');
|
||||
} catch (outerError) {
|
||||
try {
|
||||
winptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/pty.node');
|
||||
} catch (innerError) {
|
||||
console.error('innerError', innerError);
|
||||
// Re-throw the exception from the Release require if the Debug require fails as well
|
||||
throw outerError;
|
||||
}
|
||||
}
|
||||
winptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/pty.node');
|
||||
}
|
||||
}
|
||||
this._ptyNative = this._useConpty ? conptyNative : winptyNative;
|
||||
|
||||
Reference in new issue
Block a user