提交 45a797be 编写于 作者: J Johannes Rieken

check for input box options, fixes #7013

上级 6e366f56
......@@ -146,4 +146,10 @@ suite('window namespace tests', () => {
subscription.dispose();
}).then(passOncePlease, failOncePlease);
});
test('#7013 - input without options', function () {
let p = window.showInputBox();
assert.ok(typeof p === 'object');
});
});
......@@ -232,7 +232,9 @@ export class ExtHostAPIImplementation {
showQuickPick: (items: any, options: vscode.QuickPickOptions) => {
return extHostQuickOpen.show(items, options);
},
showInputBox: extHostQuickOpen.input.bind(extHostQuickOpen),
showInputBox(options?: vscode.InputBoxOptions) {
return extHostQuickOpen.input(options);
},
createStatusBarItem(position?: vscode.StatusBarAlignment, priority?: number): vscode.StatusBarItem {
return extHostStatusBar.createStatusBarEntry(<number>position, priority);
......
......@@ -101,8 +101,8 @@ export class ExtHostQuickOpen {
// ---- input
input(options?: InputBoxOptions): Thenable<string> {
this._validateInput = options.validateInput;
return this._proxy.$input(options, typeof options.validateInput === 'function');
this._validateInput = options && options.validateInput;
return this._proxy.$input(options, options && typeof options.validateInput === 'function');
}
$validateInput(input: string): TPromise<string> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册