Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
04c723d
tools: update cpplint to r456
bnoordhuis Jun 28, 2016
fc10624
tools: disable unwanted cpplint rules again
bnoordhuis Jun 28, 2016
bb81d69
tools: add back --mode=tap to cpplint
bnoordhuis Jun 28, 2016
fadf66a
tools: allow cpplint to run outside git repo
bnoordhuis Jun 28, 2016
19ec5d7
src: fix build/c++tr1 cpplint warnings
bnoordhuis Jun 28, 2016
e9559d0
src: fix build/header_guard cpplint warnings
bnoordhuis Jun 28, 2016
29228c4
src: fix readability/braces cpplint warnings
bnoordhuis Jun 28, 2016
df3a192
src: fix readability/constructors cpplint warnings
bnoordhuis Jun 28, 2016
8e39522
src: fix readability/inheritance cpplint warnings
bnoordhuis Jun 28, 2016
0ba0eca
src: fix readability/namespace cpplint warnings
bnoordhuis Jun 28, 2016
d112df4
src: fix readability/nolint cpplint warnings
bnoordhuis Jun 28, 2016
1243134
src: fix runtime/indentation_namespace warnings
bnoordhuis Jun 28, 2016
ae0c650
src: fix runtime/int cpplint warnings
bnoordhuis Jun 28, 2016
2f2002a
src: fix runtime/references cpplint warnings
bnoordhuis Jun 28, 2016
0daffdf
src: fix whitespace/blank_line cpplint warnings
bnoordhuis Jun 28, 2016
97aeb0a
src: fix whitespace/indent cpplint warnings
bnoordhuis Jun 28, 2016
f52e26f
build: remove unused files from CPPLINT_FILES
bnoordhuis Jun 28, 2016
a26c3cd
src: lint node_win32_perfctr_provider.cc
bnoordhuis Jun 28, 2016
f1d2792
src: lint node_lttng_tp.h
bnoordhuis Jun 28, 2016
dbe4b58
src: lint v8abbr.h
bnoordhuis Jun 28, 2016
9a6439a
tools: fix -Wunused-variable warning
bnoordhuis Jun 28, 2016
f8d3f6f
src: remove obsolete NOLINT comments
bnoordhuis Jun 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
src: fix runtime/references cpplint warnings
PR-URL: #7462
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
bnoordhuis committed Jun 28, 2016
commit 2f2002a75c06e1302e2b711c5516149ccd12cc7d
17 changes: 9 additions & 8 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ class ContextifyScript : public BaseObject {

// Do the eval within this context
Environment* env = Environment::GetCurrent(args);
EvalMachine(env, timeout, display_errors, break_on_sigint, args, try_catch);
EvalMachine(env, timeout, display_errors, break_on_sigint, args,
&try_catch);
}

// args: sandbox, [options]
Expand Down Expand Up @@ -610,7 +611,7 @@ class ContextifyScript : public BaseObject {
display_errors,
break_on_sigint,
args,
try_catch)) {
&try_catch)) {
contextify_context->CopyProperties();
}

Expand Down Expand Up @@ -821,7 +822,7 @@ class ContextifyScript : public BaseObject {
const bool display_errors,
const bool break_on_sigint,
const FunctionCallbackInfo<Value>& args,
TryCatch& try_catch) {
TryCatch* try_catch) {
if (!ContextifyScript::InstanceOf(env, args.Holder())) {
env->ThrowTypeError(
"Script methods can only be called on script instances.");
Expand Down Expand Up @@ -855,8 +856,8 @@ class ContextifyScript : public BaseObject {
result = script->Run();
}

if (try_catch.HasCaught()) {
if (try_catch.HasTerminated())
if (try_catch->HasCaught()) {
if (try_catch->HasTerminated())
env->isolate()->CancelTerminateExecution();

// It is possible that execution was terminated by another timeout in
Expand All @@ -873,17 +874,17 @@ class ContextifyScript : public BaseObject {
// letting try_catch catch it.
// If execution has been terminated, but not by one of the watchdogs from
// this invocation, this will re-throw a `null` value.
try_catch.ReThrow();
try_catch->ReThrow();

return false;
}

if (result.IsEmpty()) {
// Error occurred during execution of the script.
if (display_errors) {
DecorateErrorStack(env, try_catch);
DecorateErrorStack(env, *try_catch);
}
try_catch.ReThrow();
try_catch->ReThrow();
return false;
}

Expand Down
53 changes: 27 additions & 26 deletions tools/icu/iculslocs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ void usage() {
PROG);
}

#define ASSERT_SUCCESS(what) \
if (U_FAILURE(status)) { \
#define ASSERT_SUCCESS(status, what) \
if (U_FAILURE(*status)) { \
u_printf("%s:%d: %s: ERROR: %s %s\n", \
__FILE__, \
__LINE__, \
PROG, \
u_errorName(status), \
u_errorName(*status), \
what); \
return 1; \
}
Expand Down Expand Up @@ -177,9 +177,9 @@ int localeExists(const char* loc, UBool* exists) {
}
}

void printIndent(const LocalUFILEPointer& bf, int indent) {
void printIndent(const LocalUFILEPointer* bf, int indent) {
for (int i = 0; i < indent + 1; i++) {
u_fprintf(bf.getAlias(), " ");
u_fprintf(bf->getAlias(), " ");
}
}

Expand All @@ -189,15 +189,15 @@ void printIndent(const LocalUFILEPointer& bf, int indent) {
* @return 0 for OK, 1 for err
*/
int dumpAllButInstalledLocales(int lev,
LocalUResourceBundlePointer& bund,
LocalUFILEPointer& bf,
UErrorCode& status) {
ures_resetIterator(bund.getAlias());
const UBool isTable = (UBool)(ures_getType(bund.getAlias()) == URES_TABLE);
LocalUResourceBundlePointer* bund,
LocalUFILEPointer* bf,
UErrorCode* status) {
ures_resetIterator(bund->getAlias());
const UBool isTable = (UBool)(ures_getType(bund->getAlias()) == URES_TABLE);
LocalUResourceBundlePointer t;
while (U_SUCCESS(status) && ures_hasNext(bund.getAlias())) {
t.adoptInstead(ures_getNextResource(bund.getAlias(), t.orphan(), &status));
ASSERT_SUCCESS("while processing table");
while (U_SUCCESS(*status) && ures_hasNext(bund->getAlias())) {
t.adoptInstead(ures_getNextResource(bund->getAlias(), t.orphan(), status));
ASSERT_SUCCESS(status, "while processing table");
const char* key = ures_getKey(t.getAlias());
if (VERBOSE > 1) {
u_printf("dump@%d: got key %s\n", lev, key);
Expand All @@ -208,22 +208,22 @@ int dumpAllButInstalledLocales(int lev,
}
} else {
printIndent(bf, lev);
u_fprintf(bf.getAlias(), "%s", key);
u_fprintf(bf->getAlias(), "%s", key);
switch (ures_getType(t.getAlias())) {
case URES_STRING: {
int32_t len = 0;
const UChar* s = ures_getString(t.getAlias(), &len, &status);
ASSERT_SUCCESS("getting string");
u_fprintf(bf.getAlias(), ":string {\"");
u_file_write(s, len, bf.getAlias());
u_fprintf(bf.getAlias(), "\"}");
const UChar* s = ures_getString(t.getAlias(), &len, status);
ASSERT_SUCCESS(status, "getting string");
u_fprintf(bf->getAlias(), ":string {\"");
u_file_write(s, len, bf->getAlias());
u_fprintf(bf->getAlias(), "\"}");
} break;
default: {
u_printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n");
return 1;
} break;
}
u_fprintf(bf.getAlias(), "\n");
u_fprintf(bf->getAlias(), "\n");
}
}
return 0;
Expand All @@ -250,18 +250,18 @@ int list(const char* toBundle) {

// first, calculate the bundle name.
calculatePackageName(&status);
ASSERT_SUCCESS("calculating package name");
ASSERT_SUCCESS(&status, "calculating package name");

if (VERBOSE) {
u_printf("\"locale\": %s\n", locale);
}

LocalUResourceBundlePointer bund(
ures_openDirect(packageName.data(), locale, &status));
ASSERT_SUCCESS("while opening the bundle");
ASSERT_SUCCESS(&status, "while opening the bundle");
LocalUResourceBundlePointer installedLocales(
ures_getByKey(bund.getAlias(), INSTALLEDLOCALES, NULL, &status));
ASSERT_SUCCESS("while fetching installed locales");
ASSERT_SUCCESS(&status, "while fetching installed locales");

int32_t count = ures_getSize(installedLocales.getAlias());
if (VERBOSE) {
Expand All @@ -280,11 +280,12 @@ int list(const char* toBundle) {
"%s:table(nofallback) {\n"
" // First, everything besides InstalledLocales:\n",
locale);
if (dumpAllButInstalledLocales(0, bund, bf, status)) {
if (dumpAllButInstalledLocales(0, &bund, &bf, &status)) {
u_printf("Error dumping prolog for %s\n", toBundle);
return 1;
}
ASSERT_SUCCESS("while writing prolog"); // in case an error was missed
// in case an error was missed
ASSERT_SUCCESS(&status, "while writing prolog");

u_fprintf(bf.getAlias(),
" %s:table { // %d locales in input %s.res\n",
Expand All @@ -300,7 +301,7 @@ int list(const char* toBundle) {
for (int32_t i = 0; i < count; i++) {
subkey.adoptInstead(ures_getByIndex(
installedLocales.getAlias(), i, subkey.orphan(), &status));
ASSERT_SUCCESS("while fetching an installed locale's name");
ASSERT_SUCCESS(&status, "while fetching an installed locale's name");

const char* key = ures_getKey(subkey.getAlias());
if (VERBOSE > 1) {
Expand Down