Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
439 stars 49 forks source link

ValidationHelpers.CheckNameFormat preventing nested property access #109

Closed ProTip closed 1 year ago

ProTip commented 1 year ago

I must be daft. I'm trying to get a reference to or call a function in the engines through a property accessor(ie access the bar in foo.bar = () => {...})) however the ValidationHelpers.CheckNameFormat calls are blocking me:

https://github.com/Taritsyn/JavaScriptEngineSwitcher/blob/master/src/JavaScriptEngineSwitcher.Core/JsEngineBase.cs#L726

I don't believe Jint or V8 have issues with this. Am I missing something because surely nested prop access can't be tripping everyone up?

Taritsyn commented 1 year ago

Hello, Greg!

This is not a mistake. This was originally intended. Use the Evaluate or Execute methods for this purpose.

Remember the main purpose of this library:

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines (…). This library allows you to quickly and easily switch to using of another JavaScript engine.