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

Commit

Permalink
deps,test: fixing build break by adding unimplemented v8 functions
Browse files Browse the repository at this point in the history
We still don't support some of this functionality, so for now the
tests are disabled.
  • Loading branch information
MSLaguana committed Feb 8, 2018
1 parent 4569b28 commit aa3250d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class Global : public PersistentBase<T> {


template <class T>
class Eternal : private Persistent<T> {
class Eternal : protected Persistent<T> {
public:
Eternal() {}

Expand Down Expand Up @@ -802,6 +802,8 @@ class V8_EXPORT HandleScope {

static int NumberOfHandles(Isolate* isolate);

Isolate* GetIsolate() const;

private:
friend class EscapableHandleScope;
template <class T> friend class Local;
Expand Down Expand Up @@ -2955,6 +2957,9 @@ class V8_EXPORT Context {

Isolate* GetIsolate();

void Enter();
void Exit();

enum EmbedderDataFields { kDebugIdIndex = 0 };
void* GetAlignedPointerFromEmbedderData(int index);
void SetAlignedPointerInEmbedderData(int index, void* value);
Expand Down
10 changes: 10 additions & 0 deletions deps/chakrashim/src/v8context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ Isolate* Context::GetIsolate() {
return Isolate::GetCurrent();
}

void Context::Enter() {
// CHAKRA-TODO - Figure out what to do here.
CHAKRA_UNIMPLEMENTED();
}

void Context::Exit() {
// CHAKRA-TODO - Figure out what to do here.
CHAKRA_UNIMPLEMENTED();
}

void* Context::GetAlignedPointerFromEmbedderData(int index) {
jsrt::ContextShim * contextShim =
jsrt::IsolateShim::GetCurrent()->GetContextShim((JsContextRef)this);
Expand Down
5 changes: 5 additions & 0 deletions deps/chakrashim/src/v8handlescope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ HandleScope *HandleScope::GetCurrent() {
return current;
}

Isolate* HandleScope::GetIsolate() const {
return Isolate::GetCurrent();
}


bool HandleScope::AddLocal(JsValueRef value) {
// _locals is full, save them in _locals[0]
if (_count == kOnStackLocals) {
Expand Down
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@
],
'sources!': [
'test/cctest/test_environment.cc', # TODO: Enable these test for node-chakracore
'test/cctest/test_node_postmortem_metadata.cc',
],
'conditions': [
[ 'OS!="win" and chakracore_use_lto=="true"', {
Expand Down
4 changes: 4 additions & 0 deletions test/cctest/node_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ class EnvironmentTestFixture : public NodeTestFixture {
const Argv& argv,
NodeTestFixture* test_fixture) {
auto isolate = handle_scope.GetIsolate();
#if ENABLE_TTD_NODE
context_ = node::NewContext(isolate, false); // TODO: should we support TTD in cctest?
#else
context_ = node::NewContext(isolate);
#endif
CHECK(!context_.IsEmpty());
context_->Enter();

Expand Down

0 comments on commit aa3250d

Please sign in to comment.