JavaScriptException.cs 756 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using Jint.Native.Error;
  3. namespace Jint.Runtime
  4. {
  5. public class JavaScriptException : Exception
  6. {
  7. private readonly object _errorObject;
  8. public JavaScriptException(ErrorConstructor errorConstructor) : base("")
  9. {
  10. _errorObject = errorConstructor.Construct(Arguments.Empty);
  11. }
  12. public JavaScriptException(ErrorConstructor errorConstructor, string message)
  13. : base(message)
  14. {
  15. _errorObject = errorConstructor.Construct(new object[] { message });
  16. }
  17. public JavaScriptException(object error)
  18. : base("")
  19. {
  20. _errorObject = error;
  21. }
  22. public object Error { get { return _errorObject; } }
  23. }
  24. }