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

Commit 286db5d

Browse files
committed
chakrashim: add dummy shim for v8::ScriptOrModule and v8::Isolate::SetHostImportModuleDynamicallyCallback
1 parent 6eea849 commit 286db5d

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

Diff for: deps/chakrashim/chakrashim.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
'src/v8proxy.cc',
151151
'src/v8regexp.cc',
152152
'src/v8script.cc',
153+
'src/v8scriptormodule.cc',
153154
'src/v8sharedarraybuffer.cc',
154155
'src/v8set.cc',
155156
'src/v8signature.cc',

Diff for: deps/chakrashim/include/v8.h

+12
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class Promise;
134134
class PropertyDescriptor;
135135
class Proxy;
136136
class Script;
137+
class ScriptOrModule;
137138
class Signature;
138139
class StartupData;
139140
class StackFrame;
@@ -268,6 +269,9 @@ typedef bool (*EntropySource)(unsigned char* buffer, size_t length);
268269
typedef void (*FatalErrorCallback)(const char *location, const char *message);
269270
typedef void (*JitCodeEventHandler)(const JitCodeEvent *event);
270271

272+
typedef MaybeLocal<Promise>(*HostImportModuleDynamicallyCallback)(
273+
Local<Context> context, Local<ScriptOrModule> referrer,
274+
Local<String> specifier);
271275

272276
template <class T>
273277
class Local {
@@ -838,6 +842,11 @@ class V8_EXPORT Data {
838842
public:
839843
};
840844

845+
class V8_EXPORT ScriptOrModule {
846+
public:
847+
Local<Value> GetResourceName();
848+
};
849+
841850
class ScriptOrigin {
842851
public:
843852
explicit ScriptOrigin(
@@ -2681,6 +2690,9 @@ class V8_EXPORT Isolate {
26812690
void SetAbortOnUncaughtExceptionCallback(
26822691
AbortOnUncaughtExceptionCallback callback);
26832692

2693+
void SetHostImportModuleDynamicallyCallback(
2694+
HostImportModuleDynamicallyCallback callback);
2695+
26842696
void Enter();
26852697
void Exit();
26862698
void Dispose();

Diff for: deps/chakrashim/src/v8scriptormodule.cc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright Microsoft. All rights reserved.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files(the "Software"), to
5+
// deal in the Software without restriction, including without limitation the
6+
// rights to use, copy, modify, merge, publish, distribute, sublicense, and / or
7+
// sell copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions :
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
// IN THE SOFTWARE.
20+
21+
#include "v8chakra.h"
22+
23+
namespace v8 {
24+
Local<Value> ScriptOrModule::GetResourceName() {
25+
return Local<Value>();
26+
}
27+
} // namespace v8

Diff for: deps/chakrashim/src/v8v8.cc

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ const char *V8::GetVersion() {
9191
return versionStr;
9292
}
9393

94+
void Isolate::SetHostImportModuleDynamicallyCallback(
95+
HostImportModuleDynamicallyCallback callback) {
96+
// CHAKRA-TODO
97+
}
98+
9499
void Isolate::SetFatalErrorHandler(FatalErrorCallback that) {
95100
// CONSIDER: Ignoring for now, since we don't have an equivalent concept.
96101
}

Diff for: test/es-module/es-module.status

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ prefix es-module
1010
# These tests are failing for Node-Chakracore and should eventually be fixed
1111
test-esm-basic-imports : SKIP
1212
test-esm-double-encoding : SKIP
13+
test-esm-dynamic-import : SKIP
1314
test-esm-encoded-path : SKIP
1415
test-esm-encoded-path-native : SKIP
1516
test-esm-example-loader : SKIP

0 commit comments

Comments
 (0)