Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

this value in ExtendedScript

Participant ,
Oct 14, 2019 Oct 14, 2019

Hello, I have a problem with ExtendedScript, I have differents values of this in Chrome and ExtendedScript.

Why in third, fourth and fifth test, I have this = myObject.method ?

 

var myObject = {
method: function () {
alert(this);
}
};

myObject.method(); // myObject object in Google Chrome and ESTK
(myObject.method)(); // myObject object in Google Chrome and ESTK
(myObject.method = myObject.method)(); // myObject object in Google Chrome but method function in ESTK
(false || myObject.method)(); // myObject object in Google Chrome but method function in ESTK
(myObject.method, myObject.method)(); // myObject object in Google Chrome but method function in ESTK

TOPICS
Bug , Scripting , SDK
332
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Oct 18, 2019 Oct 18, 2019
LATEST

Adobe  is using  ExtendScript which is something like ES3.
Back in ES3 things like object worked different. I'm assuming that there is some transpiling going on, which translates new ES6 features into ES3.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines