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

Commit

Permalink
src: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed Oct 8, 2018
1 parent 0a55d6d commit bdac05e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
'lib/internal/v8_prof_polyfill.js',
'lib/internal/v8_prof_processor.js',
'lib/internal/validators.js',
'lib/internal/vm/source_text_module.js',
'lib/internal/stream_base_commons.js',
'lib/internal/worker.js',
'lib/internal/streams/lazy_transform.js',
Expand Down
28 changes: 0 additions & 28 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,30 +443,6 @@ inline bool ShouldBeTreatedAsRelativeOrAbsolutePath(
return false;
}

std::string ReadFile(uv_file file) {
std::string contents;
uv_fs_t req;
char buffer_memory[4096];
uv_buf_t buf = uv_buf_init(buffer_memory, sizeof(buffer_memory));
int r;

do {
r = uv_fs_read(uv_default_loop(),
&req,
file,
&buf,
1,
contents.length(), // offset
nullptr);
uv_fs_req_cleanup(&req);

if (r <= 0)
break;
contents.append(buf.base, r);
} while (true);
return contents;
}

enum CheckFileOptions {
LEAVE_OPEN_AFTER_CHECK,
CLOSE_AFTER_CHECK
Expand Down Expand Up @@ -536,10 +512,6 @@ Maybe<URL> ResolveExtensions(const URL& search) {
return Nothing<URL>();
}

inline Maybe<URL> ResolveIndex(const URL& search) {
return ResolveExtensions<ONLY_VIA_EXTENSIONS>(URL("index", search));
}

Maybe<URL> ResolveModule(Environment* env,
const std::string& specifier,
const URL& base) {
Expand Down
11 changes: 11 additions & 0 deletions src/module_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
namespace node {
namespace loader {

enum ScriptType : int {
kScript,
kModule,
};

enum HostDefinedOptions : int {
kType = 8,
kID = 9,
kLength = 10,
};

v8::Maybe<url::URL> Resolve(Environment* env,
const std::string& specifier,
const url::URL& base);
Expand Down

0 comments on commit bdac05e

Please sign in to comment.