Skip to main content
gustavopi
Participating Frequently
Oct 6, 2021 8:58 PM UTC
Question

Javascript async keyword not recognized for a class method

Using Dreamweaver for coding php is really different from JavaScript where I had to turn off a lot of uneuseful "errors" warnings. I did it consulting the experts and documentation of ecmascript starndards.

But as I started to work with classes, this error is appearing and disturbing the code debug. DW points the error and won't check the rest:

    async cameraIni() {
        var inst = this;
        this.Camera.inibutton.disabled = true;
        this.Camera.stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false });
        this.Camera.video.srcObject = this.Camera.stream;
        console.log("imgUpload Camera straming...");
        this.Camera.video.play();
    }

ERROR: Parsing error: Unexpected token cameraIni

The code will work normally in browsers, also is widelly used by this kind of application with media.

I think we might consider this a real bug. Is there some workaround? 

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

BenPleysier
Community Expert
Community Expert
Oct 6, 2021 10:42 PM UTC

If, what Nancy has said, does not work, then think about running Visual Studio alongside Dreamweaver. Visual studio for JS

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Participating Frequently
Oct 8, 2021 1:52 PM UTC

Thank's but my notebook is not enough to run Dreamweaver and Visual Studio (and other tools needed). I have some C# projects that I use Visual Studio, don't know it's JS capatilities... will try, I have some (almost) pure JavaScript projects.

Translate
Nancy OShea
Community Expert
Community Expert
Oct 6, 2021 9:44 PM UTC

Optionally, you can add it to JS Lint Configuration File from Site settings.  See screenshot.

 

 

Translate
Nancy O'Shea— Product User & Community Expert