summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/node_contextify.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 7ca622de43..c2ff517abc 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -518,10 +518,11 @@ class ContextifyScript : public BaseObject {
ScriptCompiler::CachedData* cached_data = nullptr;
if (!cached_data_buf.IsEmpty()) {
- ArrayBuffer::Contents contents =
- cached_data_buf.ToLocalChecked()->Buffer()->GetContents();
+ Local<Uint8Array> ui8 = cached_data_buf.ToLocalChecked();
+ ArrayBuffer::Contents contents = ui8->Buffer()->GetContents();
cached_data = new ScriptCompiler::CachedData(
- static_cast<uint8_t*>(contents.Data()), contents.ByteLength());
+ static_cast<uint8_t*>(contents.Data()) + ui8->ByteOffset(),
+ ui8->ByteLength());
}
ScriptOrigin origin(filename, lineOffset, columnOffset);