This commit is contained in:
walterhiggins 2014-03-10 23:17:58 +00:00
parent fae2b6aac7
commit e40786d727

View file

@ -34,6 +34,7 @@ var _getProperties = function( o ) {
j,
isObjectMethod,
typeofProperty;
if ( _isJavaObject( o ) ) {
propertyLoop:
for ( i in o ) {
@ -103,6 +104,7 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
if ( pluginCmd.name == 'jsp' ) {
return tabCompleteJSP( result, cmdSender, pluginCmd, cmdAlias, cmdArgs );
}
global.self = cmdSender; // bring in self just for autocomplete
_globalSymbols = _getProperties(global);
@ -117,6 +119,7 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
propsOfLastArg = _globalSymbols;
} else {
statementSyms = statement.split(/[^\$a-zA-Z0-9_\.]/);
lastSymbol = statementSyms[statementSyms.length-1];
//print('DEBUG: lastSymbol=[' + lastSymbol + ']');
//
@ -124,18 +127,22 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
//
parts = lastSymbol.split(/\./);
name = parts[0];
symbol = global[name];
lastGoodSymbol = symbol;
if ( typeof symbol != 'undefined' ) {
if ( typeof symbol !== 'undefined' ) {
for ( i = 1; i < parts.length; i++ ) {
name = parts[i];
symbol = symbol[name];
if ( !name ) { // fix issue #115
break;
}
symbol = symbol[name]; // this causes problem in jre8 if name is ''
if ( typeof symbol == 'undefined' ) {
break;
}
lastGoodSymbol = symbol;
}
//print('debug:name['+name+']lastSymbol['+lastSymbol+']symbol['+symbol+']');
if ( typeof symbol == 'undefined' ) {
//
// look up partial matches against last good symbol