Package: libv8
Severity: normal
I'm not sure this is actually a bug in libv8 but in how node and
chromium call it. Copying the v8 example code (attached) and running it
produces the desired output.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.37-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
#include
#include
using namespace v8;
int main() {
// Create a stack-allocated handle scope.
HandleScope handle_scope;
// Create a new context.
Persistent context = Context::New();
// Enter the created context for compiling and
// running the hello world script.
Context::Scope context_scope(context);
// Create a string containing the _javascript_ source code.
Handle source = String::New("(new Date()).getTimezoneOffset()");
// Compile the source code.
Handle> script = Script::Compile(source);
// Run the script to get the result.
Handle result = script->Run();
// Dispose the persistent context.
context.Dispose();
// Convert the result to an ASCII string and print it.
String::AsciiValue ascii(result);
printf("%s\n", *ascii);
return 0;
}