Questions tagged [embedded-v8]
253 questions
5
votes
1 answer
v8::FunctionTemplate referencing a non-global variable
Google's v8 documentation describes how to add a global function to a JavaScript context. We can implement a printf-like function quite easily using the new lambda feature from C++11:
Handle global =…

Benjamin Kay
- 464
- 2
- 11
5
votes
3 answers
"Hello World" + JS V8 + VS2010
I downloaded and built JS V8 for using in VS2010 in Release mode. Now I try run Hello World example:
#include "v8.h"
int _tmain(int argc, _TCHAR* argv[])
{
v8::HandleScope handle_scope;
v8::Persistent context =…

ibn_maksimys
- 119
- 1
- 1
- 5
5
votes
2 answers
Why does v8 saves the source code of native javascript in generated binaries?
I've been studying the v8 source, particularly at how the 'mksnapshot' tool includes a compiled image of the native javascript files(runtime.js, json.js...) in the v8 binaries and noticed that it also includes a (somewhat) minified version of the…

Thiago Padilha
- 4,590
- 5
- 44
- 69
4
votes
1 answer
How do scopes and thread locals work in (V8's) C++?
I am intrigued by how V8's scopes work.
How can a scope object on the stack find other scope objects and contexts further up the stack?
Digging into how HandleScopes worked I found that they rely on thread locals. This has left me wondering how…

chillitom
- 24,888
- 17
- 83
- 118
4
votes
1 answer
Invalidating handles that point to a deleted C++ object
When a C++ object that is exposed to v8 is deleted, how can I invalidate handles that may pointed to this object.
I'm using v8 as a scripting interface to a larger application. Objects in the larger application are wrapped and accessed in v8…

aughey
- 458
- 3
- 8
4
votes
1 answer
Hello World example for V8 using gyp
Since SCons has been deprecated. I used the gyp to generate vs solution.
I did what they told me on the build BuildingWithGYP.
And the v8 project builded ok!
and I got the v8_base.lib but no v8.lib.
And in the hello world project ,get started.I add…

Anghoo
- 49
- 3
4
votes
4 answers
Are there any HTML5 Canvas implementations for embedding in c++
I'm working on a browser based game atm and already looking into options porting it to other platforms such as consoles or devices where playing in a web browser may not be suitable.
The game is pretty much all JavaScript with rendering done via a…

Tristan
- 3,845
- 5
- 35
- 58
4
votes
1 answer
Building V8 on Windows does not output v8_base.lib
I want to build V8 and embed it in a C++ program to use SWIG to allow a Javascript app to call into the C++ library. However, after following the steps for building V8, I am missing some of the important libs for linking to V8 (e.g.…

midrangemonroe
- 41
- 4
4
votes
1 answer
Including Google's V8 Javascript Engine in a QTCreator C++ Console Project
How do I include Google's V8 Javascript Engine in a QTCreator Console Project?
I have already compiled V8 and I have played around with the example shell and d8 developer shell. I'd like to start writing code to use this library in QTCreator.
I'm…

TheAutumnAurora
- 123
- 1
- 7
4
votes
1 answer
Access violation executing location 0x0000000000000000 after calling Isolate::New()
I can't seem to figure out something getting V8 started up. I have this code:
if (!_V8Initialized)
{
v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData("x86\\"); // (this loads ok, I checked)
auto platform =…

James Wilkins
- 6,836
- 3
- 48
- 73
4
votes
1 answer
How to return a new V8 javascript "class" instance from within C++?
When using V8 as a scripting engine I expose a C++ function called construct_with_ec6_syntax to Javascript. This function, when invoked, should simply return an instance of some_ec6_class.
This C++ function should basically do the following…

Ray Burgemeestre
- 1,230
- 8
- 13
4
votes
1 answer
How to tell that a v8 isolate instance uses too much memory?
I am using Google's v8 engine for embedding javascript in my application. At certain times, I will be invoking user-supplied code, and I want to ensure that it does not behave badly by allocating too much memory. Currently, when the javascript…

markt1964
- 2,638
- 2
- 22
- 54
4
votes
1 answer
How do I use the Google V8 Engine in a different c++ Project?
If I import the .lib and .h files in the Google V8 Engine, it will attempt to use them in a different c ++ project.
Do I need to import a file of any name?
When the source of the v8 was compile and build,…

Kito
- 45
- 10
4
votes
2 answers
How to call a javascript callback from C++
I'm trying to call a callback in V8 from another point of my function. So this piece of code register the callback:
if (args.Length())
{
String::Utf8Value event(args[0]->ToString());
if (event.length())
…

Vinz243
- 9,654
- 10
- 42
- 86
4
votes
1 answer
How JavaScript is Executed in Google V8 specially Canvas related code
gurus i am trying to understand the working of Google-V8 engine,
I cam across https://developers.google.com/v8/get_started as far as i understand, V8 takes javascript as input, then you compile it and get the output, as in the above example we get…

Rohit
- 1,001
- 1
- 11
- 20