Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: samples/shell.cc

Issue 18899002: Initialize ICU data files in d8 and disable i18n for other code samples (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/process.cc ('k') | src/d8.cc » ('j') | src/icu_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void Version(const v8::FunctionCallbackInfo<v8::Value>& args); 60 void Version(const v8::FunctionCallbackInfo<v8::Value>& args);
61 v8::Handle<v8::String> ReadFile(const char* name); 61 v8::Handle<v8::String> ReadFile(const char* name);
62 void ReportException(v8::Isolate* isolate, v8::TryCatch* handler); 62 void ReportException(v8::Isolate* isolate, v8::TryCatch* handler);
63 63
64 64
65 static bool run_shell; 65 static bool run_shell;
66 66
67 67
68 int main(int argc, char* argv[]) { 68 int main(int argc, char* argv[]) {
69 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); 69 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
70 v8::V8::SetFlagsFromString("--noenable_i18n",
71 static_cast<int>(strlen("--noenable_i18n")));
70 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 72 v8::Isolate* isolate = v8::Isolate::GetCurrent();
71 run_shell = (argc == 1); 73 run_shell = (argc == 1);
72 int result; 74 int result;
73 { 75 {
74 v8::HandleScope handle_scope(isolate); 76 v8::HandleScope handle_scope(isolate);
75 v8::Handle<v8::Context> context = CreateShellContext(isolate); 77 v8::Handle<v8::Context> context = CreateShellContext(isolate);
76 if (context.IsEmpty()) { 78 if (context.IsEmpty()) {
77 fprintf(stderr, "Error creating context\n"); 79 fprintf(stderr, "Error creating context\n");
78 return 1; 80 return 1;
79 } 81 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 fprintf(stderr, "^"); 347 fprintf(stderr, "^");
346 } 348 }
347 fprintf(stderr, "\n"); 349 fprintf(stderr, "\n");
348 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); 350 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
349 if (stack_trace.length() > 0) { 351 if (stack_trace.length() > 0) {
350 const char* stack_trace_string = ToCString(stack_trace); 352 const char* stack_trace_string = ToCString(stack_trace);
351 fprintf(stderr, "%s\n", stack_trace_string); 353 fprintf(stderr, "%s\n", stack_trace_string);
352 } 354 }
353 } 355 }
354 } 356 }
OLDNEW
« no previous file with comments | « samples/process.cc ('k') | src/d8.cc » ('j') | src/icu_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698