CodeEditor - manually closing a tag causes crash
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
What is the issue and how can we reproduce it?
In an application containing the CodeEditor (in "html" mode) a blocking javascript error occurs when manually closing a tag .
The problem in source code is located in the "function is(token, type)...".
In the file sap\ui\codeeditor\js\ace\mode-javascript-dbg.js there are two versions of this function:
(1st version)
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
(2nd version)
function is(token, type) {
return token.type.lastIndexOf(type + ".xml") > -1;
}
The 2nd version is the one with produces the bug (when "token" is unndefined). When I replace this code
with the 1st version of the "is(..)" function, the bug is fixed.
Which OpenUI5 version is your project targeting?
1.152, 1.150
Is the issue device- or browser-specific?
No response
Confirmation
- I have searched the existing issues and reviewed the relevant documentation as well as the API reference.
- I am not disclosing any internal or sensitive information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the crash in an application using CodeEditor in "html" mode while manually closing a tag. Inspect the two is(token, type) implementations in sap/ui/codeeditor/js/ace/mode-javascript-dbg.js, then verify that closing a tag no longer produces a blocking JavaScript error in the targeted OpenUI5 versions 1.152 and 1.150.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100