You are correct. That is calling the
New on the
C++ (or STL) doesn't have a native
String class, there is a
string class, but it doesn't have a
::New method. You'll have to make sure you're reading the right documentation :)
It's possible that it's inherited from a base-class, so make sure you check if
String is part of an inheritance hierarchy.
Here's the deal with v8's String. It's interesting.
There are two implementations:
- v8::String - the externally visible one (Here is doxygen documentation showing the class hierarchy).
- v8::internal::String - the internal representation.
Browsing the internal String source code,
It turns out that Google Code's UI is broken (maybe they have a maximum character count?). The v8::internal::HeapObject source code should be in
src/objects.h, but the file is truncated. And the externally visible v8::String source code should be in
include/v8.h, but it too is truncated.
You can download the source and view the files. Here is what it says: