-
- Downloads
Native JS methods must return JS_FALSE for (Error) exceptions to be thrown
I discovered the first case when FileBase.get_path() failed, but didn't (immediately) throw an exception. Reviewing the other instances of JS_RepoertError() calls found several that either reported a garbage (e.g. NULL) string value or returned JS_TRUE. The design pattern used a little in js_socket.c probably should be used more: if (JS_IsExceptionPending(cx)) return JS_FALSE; return JS_TRUE; ... but that's more of a refactor than I had the stomach for right now.
Showing
- src/sbbs3/js_bbs.cpp 1 addition, 1 deletionsrc/sbbs3/js_bbs.cpp
- src/sbbs3/js_file.c 4 additions, 8 deletionssrc/sbbs3/js_file.c
- src/sbbs3/js_filebase.c 24 additions, 14 deletionssrc/sbbs3/js_filebase.c
- src/sbbs3/js_msgbase.c 2 additions, 2 deletionssrc/sbbs3/js_msgbase.c
- src/sbbs3/js_socket.c 1 addition, 1 deletionsrc/sbbs3/js_socket.c
Loading
Please register or sign in to comment