From 5131e0a1ef735a10a6b1bacb8a86a0589455f3a7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 9 Mar 2009 01:23:41 +0100 Subject: [PATCH] better error messages --- node.cc | 176 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 108 insertions(+), 68 deletions(-) diff --git a/node.cc b/node.cc index c1fce10ef6..78b36ee649 100644 --- a/node.cc +++ b/node.cc @@ -57,58 +57,8 @@ ReadFile (const string& name) return result; } -static void -ParseOptions (int argc, char* argv[], map& options, string* file) -{ - for (int i = 1; i < argc; i++) { - string arg = argv[i]; - int index = arg.find('=', 0); - if (index == string::npos) { - *file = arg; - } else { - string key = arg.substr(0, index); - string value = arg.substr(index+1); - options[key] = value; - } - } -} - -static bool -compile (Handle script) -{ - HandleScope handle_scope; - - // We're just about to compile the script; set up an error handler to - // catch any exceptions the script might throw. - TryCatch try_catch; - - // Compile the script and check for errors. - Handle