Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: shim missing String constructors
Browse files Browse the repository at this point in the history
Added the non-deprecated constructors for:
* String::Utf8Value
* String::Value
  • Loading branch information
kfarnung committed Mar 28, 2018
1 parent 1aa78c3 commit 4f6dd32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,9 @@ class V8_EXPORT String : public Name {

class V8_EXPORT Utf8Value {
public:
explicit Utf8Value(Handle<v8::Value> obj);
V8_DEPRECATE_SOON("Use Isolate version",
explicit Utf8Value(Local<v8::Value> obj));
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
~Utf8Value();
char *operator*() { return _str; }
const char *operator*() const { return _str; }
Expand All @@ -1347,7 +1349,9 @@ class V8_EXPORT String : public Name {

class V8_EXPORT Value {
public:
explicit Value(Handle<v8::Value> obj);
V8_DEPRECATE_SOON("Use Isolate version",
explicit Value(Local<v8::Value> obj));
Value(Isolate* isolate, Local<v8::Value> obj);
~Value();
uint16_t *operator*() { return _str; }
const uint16_t *operator*() const { return _str; }
Expand Down
6 changes: 6 additions & 0 deletions deps/chakrashim/src/v8string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ String::Utf8Value::Utf8Value(Handle<v8::Value> obj)
}
}

String::Utf8Value::Utf8Value(Isolate* isolate, Local<v8::Value> obj)
: Utf8Value(obj) {}

String::Utf8Value::~Utf8Value() {
if (_str != nullptr) {
free(_str);
Expand All @@ -60,6 +63,9 @@ String::Value::Value(Handle<v8::Value> obj) : _str(nullptr), _length(0) {
str->Write(_str);
}

String::Value::Value(Isolate* isolate, Local<v8::Value> obj)
: Value(obj) {}

String::Value::~Value() {
if (_str != nullptr) {
delete _str;
Expand Down

0 comments on commit 4f6dd32

Please sign in to comment.