Skip to main content
gustavopi
Participating Frequently
October 6, 2021
Question

Javascript async keyword not recognized for a class method

  • October 6, 2021
  • 2 replies
  • 629 views

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 has been closed for replies.

2 replies

BenPleysier
Community Expert
Community Expert
October 6, 2021

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

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Participating Frequently
October 8, 2021

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.

Nancy OShea
Community Expert
Community Expert
October 6, 2021

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

 

 

Nancy O'Shea— Product User & Community Expert