-
Notifications
You must be signed in to change notification settings - Fork 279
Do not attach ui after parse #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ var UI = function (_EventEmitter) { | |
| function UI() { | ||
| _classCallCheck(this, UI); | ||
|
|
||
| var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UI).call(this)); | ||
| var _this = _possibleConstructorReturn(this, (UI.__proto__ || Object.getPrototypeOf(UI)).call(this)); | ||
|
|
||
| var self = _this; | ||
|
|
||
|
|
@@ -193,7 +193,7 @@ var UI = function (_EventEmitter) { | |
| value: function prompt(options, cb) { | ||
| var _this2 = this; | ||
|
|
||
| var prompt = undefined; | ||
| var prompt = void 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would prefer the use of the
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think On doing reviews, makes sure you're looking at |
||
| options = options || {}; | ||
| if (!this.parent) { | ||
| return prompt; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,11 +163,11 @@ Vorpal.prototype.parse = function (argv, options) { | |
| args[i] = '"' + args[i] + '"'; | ||
| } | ||
| } | ||
| ui.attach(result); | ||
| this.exec(args.join(' '), function (err) { | ||
| if (err !== undefined && err !== null) { | ||
| throw new Error(err); | ||
| } | ||
| process.exit(0); | ||
| }); | ||
| } | ||
| } | ||
|
|
@@ -540,7 +540,7 @@ vorpal._onKeypress = function (key, value) { | |
| vorpal.prompt = function () { | ||
| var _this = this; | ||
|
|
||
| var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
| var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| var userCallback = arguments[1]; | ||
|
|
||
| return new Promise(function (resolve) { | ||
|
|
@@ -553,7 +553,7 @@ vorpal.prompt = function () { | |
| } | ||
| }; | ||
|
|
||
| var prompt = undefined; | ||
| var prompt = void 0; | ||
| var ssn = _this.getSessionById(options.sessionId); | ||
|
|
||
| if (!ssn) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__proto__is deprecated, and use is highly discouraged. With the way the command object is currently passed around, this could be destructive for downstream uses.Should we should be using
UI.prototype.constructorinstead.