tidev / pulsar-titanium

Titanium SDK development tools and UI package for the Pulsar text editor
Other
36 stars 12 forks source link

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined #77

Closed m1ga closed 6 years ago

m1ga commented 6 years ago

Can't reproduce it again but when I've typed in my style this appeared:

At /home/miga/.atom/packages/appcelerator-titanium/lib/utils.js:202

TypeError: Cannot read property 'toLowerCase' of undefined
    at Object.firstCharsEqual (/packages/appcelerator-titanium/lib/utils.js:202:43)
    at Object.getAttributeNameCompletions (/packages/appcelerator-titanium/lib/providers/viewAutoCompleteProvider.js:262:25)
    at Object.getSuggestions (/packages/appcelerator-titanium/lib/providers/viewAutoCompleteProvider.js:66:23)
    at providers.forEach.provider (/usr/share/atom/resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:289:58)
    at Array.forEach (native)
    at AutocompleteManager.getSuggestionsFromProviders (/usr/share/atom/resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:265:21)
    at AutocompleteManager.findSuggestions (/usr/share/atom/resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:257:23)
    at AutocompleteManager.requestNewSuggestions (/usr/share/atom/resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:652:18)
    at AutocompleteManager.showOrHideSuggestionListForBufferChanges (/usr/share/atom/resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:718:18)
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeTextEvent (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1674:32)
    at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:964:18)
    at TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:1811:30)
    at mergeIntersectingSelections (/usr/share/atom/resources/app/src/text-editor.js:1358:25)
    at TextEditor.mergeSelections (/usr/share/atom/resources/app/src/text-editor.js:3194:26)
    at TextEditor.mergeIntersectingSelections (/usr/share/atom/resources/app/src/text-editor.js:3165:42)
    at TextEditor.mutateSelectedText (/usr/share/atom/resources/app/src/text-editor.js:1357:23)
    at TextEditor.insertText (/usr/share/atom/resources/app/src/text-editor.js:1323:23)
    at TextEditor.object.(anonymous function) [as insertText] (/usr/share/atom/resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditorComponent.didTextInput (/usr/share/atom/resources/app/src/text-editor-component.js:1647:30)

It is still 1.0.2 since its currently not showing me the 1.0.3 update.

hansemannn commented 6 years ago

It seems to be related to resolving auto-completions for class properties. The error suggests that the str2 has no characters, so accessing it via str2[0] returns undefined, and toLowerCase causes the final error. I can see that we added guards for str2, so this is not likely to happen again. If it does, please feel free to reopen!