Hi.
This making me crazy. I try to create js that fill data in cascading select list. I use IDEA for comiling and early there was ES5.1 version of JS. In new standart ES6 they change rules to work with objects so older code return only indexes of options in select list. I try to rewrite code accoding to requirements of ES6 but it creates only syntax errors and i don't understand their source.
window.onload = function(){
if((document.getElementById("select_options_coded")!= null)) {
const options = JSON.parse(document.getElementById("select_options_coded").value);
const optionsMap = new Map(Object.entries(options));
for (const key of optionsMap.keys()) {
console.log(key);
}
}
};
This is simplified part of script. It get values from hidden field on page and deploy it Map. Then in for loop i need to iterate entries to create options. but in packaging i get
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling javascript using YUI
[ERROR] syntax error
for (const key of optionsMap.keys()) {
[ERROR] syntax error
console.log(key);
[ERROR] syntax error
};
i also trey consructions like Object.entries() but with the same result.
What is hell going on?
Help me please.
First i need to change loop to .forEach construction
optionsMap.forEach(function(value, key, map){
console.log("KEY: " + key + " VALUE: " + value);
});
Secondary
Need to invalidate cache/restart in IDEA.
Alexander,
Thank you for contacting us! I'm having a look at this issue, but it's not clear what exactly you want to do. It appears that you might be trying to develop something for Jira?
If that is the case, I recommend that you try your question in our Atlassian Developer Community. The users there are more familiar with developing for Atlassian products, as the users on this community are mostly just end-users.
Let me know if you have any trouble raising your question there.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answer. I resolve this by myself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for sharing your resolution, Alexander! I'm sure it can help other users in the future should they receive this error.
Take care, and have a pleasant rest of your week.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.