Copy link to clipboard
Copied
I am trying to mkae my own class in Adobe Acrobat DC using Javascript, but I keep getting this error
"Syntax Error: class is a reserved identifier". Which doesnt make any sense as I am not making a variable called "class" I am defining a class to make objects.
Here is my code:
If anyone can help, please get back ASAP as this is a project for a client and I have a certain number of hours to work on it and get it done.
Thanks
You got it. Need to do it the old fashion. Construtor class and then prototypes. But the end result is exactly the same thing. Keep in mind that JavaScript is not true OOP, no polymorhpism, no inheritence, etc. Just simple objects.
Copy link to clipboard
Copied
May be that this is not possible in Adobe Acrobat.
Copy link to clipboard
Copied
So there is no way to make my own Classes or Objects in Adobe Acrobat?
Copy link to clipboard
Copied
Of course you can create your own object definitions.
Copy link to clipboard
Copied
There are no true classes in JavaScript, the "class" defintition is just a shortcut for creating regular javascript objects. The core JS model in the current version of Acrobat doesn't include it.
But there is nothing stopping you from just creating regular JS objects.
Copy link to clipboard
Copied
So what you are saying is that Acrobats JS model doesnt include making JS objects using ES6 classes (like how I am doing right now?). So I would need to start off by making a contructor functions (example for me it would look like fucntion LinkedList() { ...WHatever needed to construct ... } ) then use prototypes for my methods to my object?
Sorry if these are quite simple questions, I have worked with classes & objects in JS before but never contstructed them, and I recently did alot of OOP in C++, so the ES6 method made the most sense to me.
Copy link to clipboard
Copied
You got it. Need to do it the old fashion. Construtor class and then prototypes. But the end result is exactly the same thing. Keep in mind that JavaScript is not true OOP, no polymorhpism, no inheritence, etc. Just simple objects.
Copy link to clipboard
Copied
Thank you so much! Very much appreciated!