pmed / v8-nuget

NuGet package for V8 JavaScript Engine
93 stars 27 forks source link

Inconsistent symbol lists between lib and dll files #31

Closed Aincvy closed 1 year ago

Aincvy commented 1 year ago

Inconsistent symbol lists between lib and dll files... The symbols in the include folder and lib files are consistent, but they are inconsistent with the symbol table in the dll.

The relevant API file is v8-exception.h.

If you use the include files which in the package, you can compile successfully, but errors occur during execution. If you use the newer version of v8-exception.h file, problems occur during the linking phase.

The relevant function in the dll is: public: static class v8::Local<class v8::Value> __cdecl v8::Exception::TypeError(class v8::Local<class v8::String>,class v8::Local<class v8::Value>)

// Old version:
class V8_EXPORT Exception {
 public:
  static Local<Value> RangeError(Local<String> message);
  static Local<Value> ReferenceError(Local<String> message);
  static Local<Value> SyntaxError(Local<String> message);
  static Local<Value> TypeError(Local<String> message);
  static Local<Value> WasmCompileError(Local<String> message);
  static Local<Value> WasmLinkError(Local<String> message);
  static Local<Value> WasmRuntimeError(Local<String> message);
  static Local<Value> Error(Local<String> message);

  /**
   * Creates an error message for the given exception.
   * Will try to reconstruct the original stack trace from the exception value,
   * or capture the current stack trace if not available.
   */
  static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception);

  /**
   * Returns the original stack trace that was captured at the creation time
   * of a given exception, or an empty handle if not available.
   */
  static Local<StackTrace> GetStackTrace(Local<Value> exception);
};

// New version:

class V8_EXPORT Exception {
 public:
  static Local<Value> RangeError(Local<String> message,
                                 Local<Value> options = {});
  static Local<Value> ReferenceError(Local<String> message,
                                     Local<Value> options = {});
  static Local<Value> SyntaxError(Local<String> message,
                                  Local<Value> options = {});
  static Local<Value> TypeError(Local<String> message,
                                Local<Value> options = {});
  static Local<Value> WasmCompileError(Local<String> message,
                                       Local<Value> options = {});
  static Local<Value> WasmLinkError(Local<String> message,
                                    Local<Value> options = {});
  static Local<Value> WasmRuntimeError(Local<String> message,
                                       Local<Value> options = {});
  static Local<Value> Error(Local<String> message, Local<Value> options = {});

  /**
   * Creates an error message for the given exception.
   * Will try to reconstruct the original stack trace from the exception value,
   * or capture the current stack trace if not available.
   */
  static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception);

  /**
   * Returns the original stack trace that was captured at the creation time
   * of a given exception, or an empty handle if not available.
   */
  static Local<StackTrace> GetStackTrace(Local<Value> exception);
};

The affected NuGet version is: https://globalcdn.nuget.org/packages/v8-v143-x64.11.8.172.15.nupkg

Aincvy commented 1 year ago

Don't mind, I used the wrong version.