Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Is it possible to validate script syntax before executing it?

$
0
0
Thank you for the very clear and complete answer!

Reading it I start thinking that I am simply misunderstanding the way ClearScript works and worrying about a problem that does not exist. I'd make an example, let's assume this is the script to be executed (ho=an host object exposed which has 4 methods):
ho.Method1("One");
ho.Method2("Two");
hoMethod3("Three"); // the "dot" is missing - real syntax error
ho.Method4("Four");
How do things go in this case?
Does the engine recognize that Method3 call is syntactically wrong before starting the execution or when the 3-rd line is processed??

And also if this is the script:
ho.Method1("One");
ho.Method2("Two");
ho.Method34("Three"); // Typo, Method34 doesn't exist - syntax is correct (? maybe it's not from ClearScript point of view??), but host object doesn't expose this functionality
ho.Method4("Four");
Does it recognize that Method34 doesn't exist before starting the execution or when the 3-rd line is processed??

Best regards
Tomaso Tosolini

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images