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
440 stars 49 forks source link

Unhandled exception when JS exception is thrown #59

Closed dustinsoftware closed 5 years ago

dustinsoftware commented 6 years ago

A teammate got a crash when an exception was thrown. Unfortunately I do not have a repro for this.

Unhandled Exception: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. 
Parameter name: length
 at System.String.Substring(Int32 startIndex, Int32 length)
 at JavaScriptEngineSwitcher.Core.Helpers.JsErrorHelpers.GetSourceFragment(String source, Int32 position, Int32 length, Int32 columnNumber, Int32 maxFragmentLength)
 at JavaScriptEngineSwitcher.Core.Helpers.JsErrorHelpers.GetSourceFragmentFromLine(String sourceLine, Int32 columnNumber, Int32 maxFragmentLength)
 at JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine.WrapJsException(JsException originalException, String defaultDocumentName)
 at JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine.<>c__DisplayClass46_0.<InnerExecute>b__0()
 at JavaScriptEngineSwitcher.ChakraCore.ScriptDispatcher.<>c__DisplayClass11_0.<Invoke>b__0()
 at JavaScriptEngineSwitcher.ChakraCore.ScriptDispatcher.StartThread()

Current package versions

<package id="JavaScriptEngineSwitcher.ChakraCore" version="3.0.0-beta7" targetFramework="net47" />
<package id="JavaScriptEngineSwitcher.ChakraCore.Native.win-x64" version="2.4.22" targetFramework="net47" />
<package id="JavaScriptEngineSwitcher.Core" version="3.0.0-beta4" targetFramework="net47" />
Taritsyn commented 6 years ago

Hello, Dustin!

Thanks for information! I did not include, this fix in the official release because I have reached the beta numbering limit. I have published this fix as the JavaScriptEngineSwitcher.Core version 3.0.0 Beta 9 package. The next version will already have the status of release candidate.

Taritsyn commented 5 years ago

Hello, Dustin!

This error is fixed in version 3.0.0 RC 1.

Taritsyn commented 5 years ago

I close this issue because this error was fixed in release candidate.