Проблема с закрывающими скобками блока if

Code Writer App Suggestions and Support Forum

Posted 10 months ago by RadMirXAn - RUSSIA
Version: 3.2.0028
Avatar
const AudioLoader = function(){
	let current = new Object();
	current.included = new Object();
	current.context = AudioContext.context();
	current.buffer = new Object();
	current.source = new Object();
	current.next = function(urls, complete_callback, progress_callback, index){
		let next_index = index + 1;
		let url = urls[index];
		if (current.buffer[url] === undefined){
			let xhr = new XMLHttpRequest();
			xhr.open('GET', url + ANTI_CACHE, true);
			xhr.responseType = 'arraybuffer';
		}
	};
	current.load = function (urls, complete_callback, progress_callback) {
            current.next(urls, complete_callback, progress_callback, 0);
	};
	current.play = function (url, loop) {
            if (current.buffer[url] === undefined) {
                alert('Ошибка при получение файла ' + url);
            }
			if (current.source[url] != undefined) {
				current.source[url].stop(0);
            }
            current.source[url] = current.context.createBufferSource();
            current.source[url].buffer = current.buffer[url];
            current.source[url].connect(AudioContext.gain());
            current.source[url].start(0);
            current.source[url].loop = loop;
	};
	current.stop = function (url) {
            if (current.buffer[url] === undefined) {
                alert('Ошибка при получение файла ' + url);
            }
            if (current.source[url] != undefined) {
                current.source[url].stop(0);
                delete current.source[url];
            }
	};
	return current;
};

Добрый День.
В коде выше возникают проблемы со скобками. Программа не видит закрывающие скобки блока if.

скриншот 1
https://cloud.mail.ru/public/HrHT/XnQUSJomQ


скриншот 2
https://cloud.mail.ru/public/CFYA/tCZ24r9AP

 

Проблема возникает если использовать let вместо var

Работает

		if (true){
			var test = "true";
		}

 Ошибка

		if (true){
			let test = "false";
		}

[Modified 10 months ago]

Comments (1)

Answer - Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for writing.  The JavaScript parser we use in the current version still targets ECMAScript 5.1, which didn't have 'let' as a keyword yet.  We are currently working on major updates to Code Writer's core text editor control to really speed it up and add some other features.  Once those are done, updating the JavaScript parser to a newer ECMAScript version will be a high priority.


Actipro Software Support

The latest build of this product (v3.3.0029) was released 5 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.