[x3d-public] FreeWRL: I'm not sure what the standard says, but consider enabling ECMAScript's "let" in FreeWRL

John Carlson yottzumm at gmail.com
Fri Sep 15 11:52:32 PDT 2023


Oh, sorry, I meant lack of let.

On Fri, Sep 15, 2023 at 1:45 PM John Carlson <yottzumm at gmail.com> wrote:

> How about integrating another browser based ECMAScript, Bun, or Deno?
>
> I was kind of surprised by lack of var, the warnings weren’t obvious, but
> luckily I had similar code that worked, which was written by you, Doug,
> thank goodness!
>
> However, getting the code through X3D-Edit QA is another matter…
>
> I can post if people like.  The code works well, and is PROTO based.
>
> John
>
> On Fri, Sep 15, 2023 at 10:11 AM GPU Group <gpugroup at gmail.com> wrote:
>
>> Most recent duktape doesn't support "let" although some of duktape's
>> developers have tinkered with it.
>> https://github.com/svaarala/duktape/issues/2000
>> Most recent libmozjs / spidermonkey does / should support let:
>>
>> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
>>
>> x however freewrl uses an older libmozjs 24, versus most current is over
>> 100.
>> x last time I tried to build libmozjs on windows I gave up
>> -Doug
>>
>> On Thu, Sep 14, 2023 at 4:56 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Christoph.
>>>
>>> 1) These aren't global variables, they are local to a function.
>>>
>>> 2) let doesn't declare a global variable.
>>>
>>> 3) global variables are frowned and warned about in X3D.
>>>
>>> 4) let is much better for scoping than var.
>>>
>>> John
>>>
>>> On Thu, Sep 14, 2023 at 5:29 PM Christoph Valentin <
>>> christoph.valentin at gmx.at> wrote:
>>>
>>>> Just fyi......
>>>>
>>>> When I tried to write browser stiff ecmascript for X3D Script nodes, I
>>>> decided to use only var and to use it for local variables.
>>>>
>>>> I avoided to have global ecmascript variables and used "field"s of the
>>>> Script nodes instead.
>>>>
>>>> I do not remember WHY i did this decision.
>>>>
>>>> Kr,
>>>> CP/V
>>>>
>>>> --
>>>> Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail
>>>> gesendet.
>>>> Am 14.09.23, 23:01 schrieb John Carlson <yottzumm at gmail.com>:
>>>>
>>>>> Doug,
>>>>>
>>>>> Let me know if there's some configuration to enable ECMAScript's "let"
>>>>> way of declaring variables in FreeWRL.  Otherwise, I have to use var.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> John
>>>>> _______________________________________________ x3d-public mailing
>>>>> list x3d-public at web3d.org
>>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>>
>>>> _______________________________________________
>> x3d-public mailing list
>> x3d-public at web3d.org
>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230915/a623403f/attachment.html>


More information about the x3d-public mailing list