| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -561,7 +561,8 @@ class ContextifyScript : public BaseObject { | |||
| 561 | 561 | ||
| 562 | 562 | // Do the eval within this context | |
| 563 | 563 | Environment* env = Environment::GetCurrent(args); | |
| 564 | - EvalMachine(env, timeout, display_errors, break_on_sigint, args, try_catch); | ||
| 564 | + EvalMachine(env, timeout, display_errors, break_on_sigint, args, | ||
| 565 | + &try_catch); | ||
| 565 | 566 | } | |
| 566 | 567 | ||
| 567 | 568 | // args: sandbox, [options] | |
@@ -610,7 +611,7 @@ class ContextifyScript : public BaseObject { | |||
| 610 | 611 | display_errors, | |
| 611 | 612 | break_on_sigint, | |
| 612 | 613 | args, | |
| 613 | - try_catch)) { | ||
| 614 | + &try_catch)) { | ||
| 614 | 615 | contextify_context->CopyProperties(); | |
| 615 | 616 | } | |
| 616 | 617 | ||
@@ -821,7 +822,7 @@ class ContextifyScript : public BaseObject { | |||
| 821 | 822 | const bool display_errors, | |
| 822 | 823 | const bool break_on_sigint, | |
| 823 | 824 | const FunctionCallbackInfo<Value>& args, | |
| 824 | - TryCatch& try_catch) { | ||
| 825 | + TryCatch* try_catch) { | ||
| 825 | 826 | if (!ContextifyScript::InstanceOf(env, args.Holder())) { | |
| 826 | 827 | env->ThrowTypeError( | |
| 827 | 828 | "Script methods can only be called on script instances."); | |
@@ -855,8 +856,8 @@ class ContextifyScript : public BaseObject { | |||
| 855 | 856 | result = script->Run(); | |
| 856 | 857 | } | |
| 857 | 858 | ||
| 858 | - if (try_catch.HasCaught()) { | ||
| 859 | - if (try_catch.HasTerminated()) | ||
| 859 | + if (try_catch->HasCaught()) { | ||
| 860 | + if (try_catch->HasTerminated()) | ||
| 860 | 861 | env->isolate()->CancelTerminateExecution(); | |
| 861 | 862 | ||
| 862 | 863 | // It is possible that execution was terminated by another timeout in | |
@@ -873,17 +874,17 @@ class ContextifyScript : public BaseObject { | |||
| 873 | 874 | // letting try_catch catch it. | |
| 874 | 875 | // If execution has been terminated, but not by one of the watchdogs from | |
| 875 | 876 | // this invocation, this will re-throw a `null` value. | |
| 876 | - try_catch.ReThrow(); | ||
| 877 | + try_catch->ReThrow(); | ||
| 877 | 878 | ||
| 878 | 879 | return false; | |
| 879 | 880 | } | |
| 880 | 881 | ||
| 881 | 882 | if (result.IsEmpty()) { | |
| 882 | 883 | // Error occurred during execution of the script. | |
| 883 | 884 | if (display_errors) { | |
| 884 | - DecorateErrorStack(env, try_catch); | ||
| 885 | + DecorateErrorStack(env, *try_catch); | ||
| 885 | 886 | } | |
| 886 | - try_catch.ReThrow(); | ||
| 887 | + try_catch->ReThrow(); | ||
| 887 | 888 | return false; | |
| 888 | 889 | } | |
| 889 | 890 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,13 +105,13 @@ void usage() { | |||
| 105 | 105 | PROG); | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | - #define ASSERT_SUCCESS(what) \ | ||
| 109 | - if (U_FAILURE(status)) { \ | ||
| 108 | + #define ASSERT_SUCCESS(status, what) \ | ||
| 109 | + if (U_FAILURE(*status)) { \ | ||
| 110 | 110 | u_printf("%s:%d: %s: ERROR: %s %s\n", \ | |
| 111 | 111 | __FILE__, \ | |
| 112 | 112 | __LINE__, \ | |
| 113 | 113 | PROG, \ | |
| 114 | - u_errorName(status), \ | ||
| 114 | + u_errorName(*status), \ | ||
| 115 | 115 | what); \ | |
| 116 | 116 | return 1; \ | |
| 117 | 117 | } | |
@@ -177,9 +177,9 @@ int localeExists(const char* loc, UBool* exists) { | |||
| 177 | 177 | } | |
| 178 | 178 | } | |
| 179 | 179 | ||
| 180 | - void printIndent(const LocalUFILEPointer& bf, int indent) { | ||
| 180 | + void printIndent(const LocalUFILEPointer* bf, int indent) { | ||
| 181 | 181 | for (int i = 0; i < indent + 1; i++) { | |
| 182 | - u_fprintf(bf.getAlias(), " "); | ||
| 182 | + u_fprintf(bf->getAlias(), " "); | ||
| 183 | 183 | } | |
| 184 | 184 | } | |
| 185 | 185 | ||
@@ -189,15 +189,15 @@ void printIndent(const LocalUFILEPointer& bf, int indent) { | |||
| 189 | 189 | * @return 0 for OK, 1 for err | |
| 190 | 190 | */ | |
| 191 | 191 | int dumpAllButInstalledLocales(int lev, | |
| 192 | - LocalUResourceBundlePointer& bund, | ||
| 193 | - LocalUFILEPointer& bf, | ||
| 194 | - UErrorCode& status) { | ||
| 195 | - ures_resetIterator(bund.getAlias()); | ||
| 196 | - const UBool isTable = (UBool)(ures_getType(bund.getAlias()) == URES_TABLE); | ||
| 192 | + LocalUResourceBundlePointer* bund, | ||
| 193 | + LocalUFILEPointer* bf, | ||
| 194 | + UErrorCode* status) { | ||
| 195 | + ures_resetIterator(bund->getAlias()); | ||
| 196 | + const UBool isTable = (UBool)(ures_getType(bund->getAlias()) == URES_TABLE); | ||
| 197 | 197 | LocalUResourceBundlePointer t; | |
| 198 | - while (U_SUCCESS(status) && ures_hasNext(bund.getAlias())) { | ||
| 199 | - t.adoptInstead(ures_getNextResource(bund.getAlias(), t.orphan(), &status)); | ||
| 200 | - ASSERT_SUCCESS("while processing table"); | ||
| 198 | + while (U_SUCCESS(*status) && ures_hasNext(bund->getAlias())) { | ||
| 199 | + t.adoptInstead(ures_getNextResource(bund->getAlias(), t.orphan(), status)); | ||
| 200 | + ASSERT_SUCCESS(status, "while processing table"); | ||
| 201 | 201 | const char* key = ures_getKey(t.getAlias()); | |
| 202 | 202 | if (VERBOSE > 1) { | |
| 203 | 203 | u_printf("dump@%d: got key %s\n", lev, key); | |
@@ -208,22 +208,22 @@ int dumpAllButInstalledLocales(int lev, | |||
| 208 | 208 | } | |
| 209 | 209 | } else { | |
| 210 | 210 | printIndent(bf, lev); | |
| 211 | - u_fprintf(bf.getAlias(), "%s", key); | ||
| 211 | + u_fprintf(bf->getAlias(), "%s", key); | ||
| 212 | 212 | switch (ures_getType(t.getAlias())) { | |
| 213 | 213 | case URES_STRING: { | |
| 214 | 214 | int32_t len = 0; | |
| 215 | - const UChar* s = ures_getString(t.getAlias(), &len, &status); | ||
| 216 | - ASSERT_SUCCESS("getting string"); | ||
| 217 | - u_fprintf(bf.getAlias(), ":string {\""); | ||
| 218 | - u_file_write(s, len, bf.getAlias()); | ||
| 219 | - u_fprintf(bf.getAlias(), "\"}"); | ||
| 215 | + const UChar* s = ures_getString(t.getAlias(), &len, status); | ||
| 216 | + ASSERT_SUCCESS(status, "getting string"); | ||
| 217 | + u_fprintf(bf->getAlias(), ":string {\""); | ||
| 218 | + u_file_write(s, len, bf->getAlias()); | ||
| 219 | + u_fprintf(bf->getAlias(), "\"}"); | ||
| 220 | 220 | } break; | |
| 221 | 221 | default: { | |
| 222 | 222 | u_printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n"); | |
| 223 | 223 | return 1; | |
| 224 | 224 | } break; | |
| 225 | 225 | } | |
| 226 | - u_fprintf(bf.getAlias(), "\n"); | ||
| 226 | + u_fprintf(bf->getAlias(), "\n"); | ||
| 227 | 227 | } | |
| 228 | 228 | } | |
| 229 | 229 | return 0; | |
@@ -250,18 +250,18 @@ int list(const char* toBundle) { | |||
| 250 | 250 | ||
| 251 | 251 | // first, calculate the bundle name. | |
| 252 | 252 | calculatePackageName(&status); | |
| 253 | - ASSERT_SUCCESS("calculating package name"); | ||
| 253 | + ASSERT_SUCCESS(&status, "calculating package name"); | ||
| 254 | 254 | ||
| 255 | 255 | if (VERBOSE) { | |
| 256 | 256 | u_printf("\"locale\": %s\n", locale); | |
| 257 | 257 | } | |
| 258 | 258 | ||
| 259 | 259 | LocalUResourceBundlePointer bund( | |
| 260 | 260 | ures_openDirect(packageName.data(), locale, &status)); | |
| 261 | - ASSERT_SUCCESS("while opening the bundle"); | ||
| 261 | + ASSERT_SUCCESS(&status, "while opening the bundle"); | ||
| 262 | 262 | LocalUResourceBundlePointer installedLocales( | |
| 263 | 263 | ures_getByKey(bund.getAlias(), INSTALLEDLOCALES, NULL, &status)); | |
| 264 | - ASSERT_SUCCESS("while fetching installed locales"); | ||
| 264 | + ASSERT_SUCCESS(&status, "while fetching installed locales"); | ||
| 265 | 265 | ||
| 266 | 266 | int32_t count = ures_getSize(installedLocales.getAlias()); | |
| 267 | 267 | if (VERBOSE) { | |
@@ -280,11 +280,12 @@ int list(const char* toBundle) { | |||
| 280 | 280 | "%s:table(nofallback) {\n" | |
| 281 | 281 | " // First, everything besides InstalledLocales:\n", | |
| 282 | 282 | locale); | |
| 283 | - if (dumpAllButInstalledLocales(0, bund, bf, status)) { | ||
| 283 | + if (dumpAllButInstalledLocales(0, &bund, &bf, &status)) { | ||
| 284 | 284 | u_printf("Error dumping prolog for %s\n", toBundle); | |
| 285 | 285 | return 1; | |
| 286 | 286 | } | |
| 287 | - ASSERT_SUCCESS("while writing prolog"); // in case an error was missed | ||
| 287 | + // in case an error was missed | ||
| 288 | + ASSERT_SUCCESS(&status, "while writing prolog"); | ||
| 288 | 289 | ||
| 289 | 290 | u_fprintf(bf.getAlias(), | |
| 290 | 291 | " %s:table { // %d locales in input %s.res\n", | |
@@ -300,7 +301,7 @@ int list(const char* toBundle) { | |||
| 300 | 301 | for (int32_t i = 0; i < count; i++) { | |
| 301 | 302 | subkey.adoptInstead(ures_getByIndex( | |
| 302 | 303 | installedLocales.getAlias(), i, subkey.orphan(), &status)); | |
| 303 | - ASSERT_SUCCESS("while fetching an installed locale's name"); | ||
| 304 | + ASSERT_SUCCESS(&status, "while fetching an installed locale's name"); | ||
| 304 | 305 | ||
| 305 | 306 | const char* key = ures_getKey(subkey.getAlias()); | |
| 306 | 307 | if (VERBOSE > 1) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments