| 233 | } |
| 234 | |
| 235 | void ModuleInternal::LoadWorker(Local<Context> context, const string& path) { |
| 236 | TNSPERF(); |
| 237 | auto isolate = m_isolate; |
| 238 | TryCatch tc(isolate); |
| 239 | |
| 240 | Load(context, path); |
| 241 | |
| 242 | if (tc.HasCaught()) { |
| 243 | // This will handle any errors that occur when first loading a script (new worker) |
| 244 | // exceptions include: syntax errors, throw statements, access of properties of undefined objects |
| 245 | // Check if `onerror` handle is implemented |
| 246 | // Web behaviour - if onerror handle comes before exception throw - execute it, else - bubble up to main's worker object |
| 247 | CallbackHandlers::CallWorkerScopeOnErrorHandle(isolate, tc); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | void ModuleInternal::CheckFileExists(Isolate* isolate, const std::string& path, const std::string& baseDir) { |
| 252 | JEnv env; |