feat: add user_data API test and reorder WrenErrorFn vm parameter to first position
Add a new test suite for user data get/set operations on WrenVM, including a Wren script that validates default NULL userData, retrieval after VM creation, and mutation via wrenSetUserData. Also reorder the vm parameter in WrenErrorFn callback signature and all its call sites to match the convention used by other callback types, updating the typedef, the reportError implementation, and all invocations in the compiler and debug modules. Include the new source and header files in the Xcode project build configuration.
This commit is contained in:
+3
-2
@@ -96,7 +96,8 @@ typedef enum
|
||||
// Each of those has the module and line where the method or function is
|
||||
// defined and [message] is the name of the method or function.
|
||||
typedef void (*WrenErrorFn)(
|
||||
WrenErrorType type, const char* module, int line, const char* message, WrenVM* vm);
|
||||
WrenVM* vm, WrenErrorType type, const char* module, int line,
|
||||
const char* message);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -207,7 +208,7 @@ typedef struct
|
||||
// If zero, defaults to 50.
|
||||
int heapGrowthPercent;
|
||||
|
||||
// User defined state data associated with the WrenVM.
|
||||
// User-defined data associated with the VM.
|
||||
void* userData;
|
||||
|
||||
} WrenConfiguration;
|
||||
|
||||
Reference in New Issue
Block a user