From ab2a7867a625ce1b685d637fe7a117d79f5eeb33 Mon Sep 17 00:00:00 2001 From: Matheus Marchini Date: Tue, 6 Nov 2018 14:05:54 -0800 Subject: [PATCH] src: fixes for V8 6.9 and 7.0 - PositionInfo removed from SFI and PreParsedData ((v8/v8@39e2d97)[]) - PositionInfo is now available on ScopeInfo or UncompiledData - DebugInfo was removed from SFI ((v8/v8@c51bcd1)[]) - InferredName is available on ScopeInfo or UncompiledData ((v8/v8@c941f11)[]) - StackLocal removed from ScopeInfo ((v8/v8@467eb14)[]) - ParamCount (from ScopeInfo) size decreased ((v8/v8@53d4dfc)[]) [v8/v8@39e2d97]: https://github.com/v8/v8/commit/39e2d97 [v8/v8@c51bcd1]: https://github.com/v8/v8/commit/c51bcd1 [v8/v8@c941f11]: https://github.com/v8/v8/commit/c941f11 [v8/v8@467eb14]: https://github.com/v8/v8/commit/467eb14 [v8/v8@53d4dfc]: https://github.com/v8/v8/commit/53d4dfc PR-URL: https://github.com/nodejs/llnode/pull/247 Reviewed-By: Colin Ihrig --- src/llv8-constants.cc | 28 ++++- src/llv8-constants.h | 17 +++ src/llv8-inl.h | 225 +++++++++++++++++++++++++++++++--- src/llv8.cc | 16 +-- src/llv8.h | 38 +++++- test/addon/jsapi-test.js | 2 +- test/plugin/workqueue-test.js | 14 +-- 7 files changed, 295 insertions(+), 45 deletions(-) diff --git a/src/llv8-constants.cc b/src/llv8-constants.cc index 4b24030e..f73acef0 100644 --- a/src/llv8-constants.cc +++ b/src/llv8-constants.cc @@ -185,6 +185,8 @@ void JSDate::Load() { void SharedInfo::Load() { + kFunctionDataOffset = + LoadConstant("class_SharedFunctionInfo__function_data__Object"); kNameOrScopeInfoOffset = LoadConstant("class_SharedFunctionInfo__name_or_scope_info__Object"); kNameOffset = LoadConstant("class_SharedFunctionInfo__raw_name__Object", @@ -193,6 +195,8 @@ void SharedInfo::Load() { LoadConstant("class_SharedFunctionInfo__inferred_name__String", "class_SharedFunctionInfo__function_identifier__Object"); kScriptOffset = LoadConstant("class_SharedFunctionInfo__script__Object"); + kScriptOrDebugInfoOffset = + LoadConstant("class_SharedFunctionInfo__script_or_debug_info__Object"); kStartPositionOffset = LoadConstant("class_SharedFunctionInfo__start_position_and_type__int", "class_SharedFunctionInfo__start_position_and_type__SMI"); @@ -201,11 +205,12 @@ void SharedInfo::Load() { "class_SharedFunctionInfo__end_position__SMI"); kParameterCountOffset = LoadConstant( "class_SharedFunctionInfo__internal_formal_parameter_count__int", - "class_SharedFunctionInfo__internal_formal_parameter_count__SMI"); + "class_SharedFunctionInfo__internal_formal_parameter_count__uint16_t"); if (kParameterCountOffset == -1) { - kParameterCountOffset = - LoadConstant("class_SharedFunctionInfo__formal_parameter_count__SMI"); + kParameterCountOffset = LoadConstant( + "class_SharedFunctionInfo__internal_formal_parameter_count__SMI", + "class_SharedFunctionInfo__formal_parameter_count__SMI"); } // NOTE: Could potentially be -1 on v4 and v5 node, should check in llv8 @@ -229,6 +234,16 @@ void SharedInfo::Load() { } +void UncompiledData::Load() { + kInferredNameOffset = + LoadConstant("class_UncompiledData__inferred_name__String"); + kStartPositionOffset = + LoadConstant("class_UncompiledData__start_position__int32_t"); + kEndPositionOffset = + LoadConstant("class_UncompiledData__end_position__int32_t"); +} + + void Code::Load() { kStartOffset = LoadConstant("class_Code__instruction_start__uintptr_t"); kSizeOffset = LoadConstant("class_Code__instruction_size__int"); @@ -238,6 +253,7 @@ void Code::Load() { void ScopeInfo::Load() { kParameterCountOffset = LoadConstant("scopeinfo_idx_nparams"); kStackLocalCountOffset = LoadConstant("scopeinfo_idx_nstacklocals"); + kEmbeddedParamAndStackLocals = kStackLocalCountOffset != -1; kContextLocalCountOffset = LoadConstant("scopeinfo_idx_ncontextlocals"); kVariablePartIndex = LoadConstant("scopeinfo_idx_first_vars"); } @@ -516,6 +532,12 @@ void Types::Load() { kJSDateType = LoadConstant("type_JSDate__JS_DATE_TYPE"); kSharedFunctionInfoType = LoadConstant("type_SharedFunctionInfo__SHARED_FUNCTION_INFO_TYPE"); + kUncompiledDataWithoutPreParsedScopeType = LoadConstant( + "type_UncompiledDataWithoutPreParsedScope__UNCOMPILED_DATA_WITHOUT_PRE_" + "PARSED_SCOPE_TYPE"); + kUncompiledDataWithPreParsedScopeType = LoadConstant( + "type_UncompiledDataWithPreParsedScope__UNCOMPILED_DATA_WITH_PRE_PARSED_" + "SCOPE_TYPE"); kScriptType = LoadConstant("type_Script__SCRIPT_TYPE"); kScopeInfoType = LoadConstant("type_ScopeInfo__SCOPE_INFO_TYPE"); kSymbolType = LoadConstant("type_Symbol__SYMBOL_TYPE"); diff --git a/src/llv8-constants.h b/src/llv8-constants.h index 41ea8f6a..a1e6dad3 100644 --- a/src/llv8-constants.h +++ b/src/llv8-constants.h @@ -157,10 +157,12 @@ class SharedInfo : public Module { int64_t kNameOffset; int64_t kInferredNameOffset; int64_t kScriptOffset; + int64_t kScriptOrDebugInfoOffset; int64_t kStartPositionOffset; int64_t kEndPositionOffset; int64_t kParameterCountOffset; int64_t kScopeInfoOffset; + int64_t kFunctionDataOffset; int64_t kStartPositionMask; int64_t kStartPositionShift; @@ -170,6 +172,18 @@ class SharedInfo : public Module { void Load(); }; +class UncompiledData : public Module { + public: + CONSTANTS_DEFAULT_METHODS(UncompiledData); + + int64_t kInferredNameOffset; + int64_t kStartPositionOffset; + int64_t kEndPositionOffset; + + protected: + void Load(); +}; + class Code : public Module { public: CONSTANTS_DEFAULT_METHODS(Code) @@ -188,6 +202,7 @@ class ScopeInfo : public Module { int64_t kParameterCountOffset; int64_t kStackLocalCountOffset; int64_t kContextLocalCountOffset; + bool kEmbeddedParamAndStackLocals; int64_t kVariablePartIndex; protected: @@ -508,6 +523,8 @@ class Types : public Module { int64_t kJSRegExpType; int64_t kJSDateType; int64_t kSharedFunctionInfoType; + int64_t kUncompiledDataWithoutPreParsedScopeType; + int64_t kUncompiledDataWithPreParsedScopeType; int64_t kScriptType; int64_t kScopeInfoType; int64_t kSymbolType; diff --git a/src/llv8-inl.h b/src/llv8-inl.h index 994bc12d..ef8398b9 100644 --- a/src/llv8-inl.h +++ b/src/llv8-inl.h @@ -12,6 +12,11 @@ inline double LLV8::LoadValue(int64_t addr, Error& err) { return LoadDouble(addr, err); } +template <> +inline int32_t LLV8::LoadValue(int64_t addr, Error& err) { + return LoadUnsigned(addr, 4, err); +} + template inline T LLV8::LoadValue(int64_t addr, Error& err) { int64_t ptr; @@ -55,6 +60,11 @@ inline int64_t HeapObject::LoadField(int64_t off, Error& err) { } +template <> +inline int32_t HeapObject::LoadFieldValue(int64_t off, Error& err) { + return v8()->LoadValue(LeaField(off), err); +} + template <> inline double HeapObject::LoadFieldValue(int64_t off, Error& err) { return v8()->LoadValue(LeaField(off), err); @@ -83,6 +93,54 @@ inline int64_t HeapObject::GetType(Error& err) { return map.GetType(err); } +inline bool Value::IsSmi(Error& err) { + Smi smi(*this); + return smi.Check(); +} + + +inline bool Value::IsScript(Error& err) { + Smi smi(*this); + if (smi.Check()) return false; + + HeapObject heap_object(*this); + if (!heap_object.Check()) return false; + + int64_t type = heap_object.GetType(err); + if (err.Fail()) return false; + + return type == v8()->types()->kScriptType; +} + + +inline bool Value::IsScopeInfo(Error& err) { + Smi smi(*this); + if (smi.Check()) return false; + + HeapObject heap_object(*this); + if (!heap_object.Check()) return false; + + int64_t type = heap_object.GetType(err); + if (err.Fail()) return false; + + return type == v8()->types()->kScopeInfoType; +} + + +inline bool Value::IsUncompiledData(Error& err) { + Smi smi(*this); + if (smi.Check()) return false; + + HeapObject heap_object(*this); + if (!heap_object.Check()) return false; + + int64_t type = heap_object.GetType(err); + if (err.Fail()) return false; + + return type == v8()->types()->kUncompiledDataWithoutPreParsedScopeType || + type == v8()->types()->kUncompiledDataWithPreParsedScopeType; +} + inline bool HeapObject::IsJSErrorType(Error& err) { int64_t type = GetType(err); @@ -308,15 +366,50 @@ ACCESSOR(Script, LineOffset, script()->kLineOffsetOffset, Smi) ACCESSOR(Script, Source, script()->kSourceOffset, HeapObject) ACCESSOR(Script, LineEnds, script()->kLineEndsOffset, HeapObject) +ACCESSOR(SharedFunctionInfo, function_data, shared_info()->kFunctionDataOffset, + Value) ACCESSOR(SharedFunctionInfo, name, shared_info()->kNameOffset, String) -ACCESSOR(SharedFunctionInfo, InferredName, shared_info()->kInferredNameOffset, +ACCESSOR(SharedFunctionInfo, inferred_name, shared_info()->kInferredNameOffset, Value) -ACCESSOR(SharedFunctionInfo, GetScript, shared_info()->kScriptOffset, Script) +ACCESSOR(SharedFunctionInfo, script, shared_info()->kScriptOffset, Script) +ACCESSOR(SharedFunctionInfo, script_or_debug_info, + shared_info()->kScriptOrDebugInfoOffset, HeapObject) ACCESSOR(SharedFunctionInfo, scope_info, shared_info()->kScopeInfoOffset, HeapObject) ACCESSOR(SharedFunctionInfo, name_or_scope_info, shared_info()->kNameOrScopeInfoOffset, HeapObject) +ACCESSOR(UncompiledData, inferred_name, uncompiled_data()->kInferredNameOffset, + Value) +ACCESSOR(UncompiledData, start_position, + uncompiled_data()->kStartPositionOffset, int32_t) +ACCESSOR(UncompiledData, end_position, uncompiled_data()->kEndPositionOffset, + int32_t) + +Value SharedFunctionInfo::GetInferredName(Error& err) { + if (v8()->uncompiled_data()->kInferredNameOffset == -1) + return inferred_name(err); + + HeapObject maybe_scope_info = GetScopeInfo(err); + if (!err.Fail()) { + ScopeInfo scope_info(maybe_scope_info); + + Value maybe_inferred_name = scope_info.MaybeFunctionName(err); + if (!(err.Fail() && String::IsString(v8(), maybe_inferred_name, err))) + return maybe_inferred_name; + } + + err = Error::Ok(); + Value maybe_uncompiled_data = function_data(err); + if (!maybe_uncompiled_data.IsUncompiledData(err)) { + Error::PrintInDebugMode("Couldn't get UncompiledData"); + return Value(); + } + + UncompiledData uncompiled_data(maybe_uncompiled_data); + return uncompiled_data.inferred_name(err); +} + HeapObject SharedFunctionInfo::GetScopeInfo(Error& err) { if (v8()->shared_info()->kNameOrScopeInfoOffset == -1) return scope_info(err); @@ -327,6 +420,16 @@ HeapObject SharedFunctionInfo::GetScopeInfo(Error& err) { return HeapObject(); } +Script SharedFunctionInfo::GetScript(Error& err) { + if (v8()->shared_info()->kScriptOrDebugInfoOffset == -1) return script(err); + + HeapObject maybe_script = script_or_debug_info(err); + if (maybe_script.IsScript(err)) return maybe_script; + + Error::PrintInDebugMode("Couldn't get Script in SharedFunctionInfo"); + return Script(); +} + String SharedFunctionInfo::Name(Error& err) { if (v8()->shared_info()->kNameOrScopeInfoOffset == -1) return name(err); @@ -338,9 +441,12 @@ String SharedFunctionInfo::Name(Error& err) { if (err.Fail()) return String(); - HeapObject maybe_function_name = + Value maybe_function_name = ScopeInfo(maybe_scope_info).MaybeFunctionName(err); - if (err.Fail()) return String(); + if (err.Fail()) { + err = Error::Ok(); + return String(); + } if (String::IsString(v8(), maybe_function_name, err)) return maybe_function_name; @@ -374,17 +480,68 @@ ACCESSOR(JSArrayBufferView, ByteOffset, ACCESSOR(JSArrayBufferView, ByteLength, js_array_buffer_view()->kByteLengthOffset, Smi) +inline ScopeInfo::PositionInfo ScopeInfo::MaybePositionInfo(Error& err) { + ScopeInfo::PositionInfo position_info = { + .start_position = 0, .end_position = 0, .is_valid = false}; + int proper_index = ContextLocalIndex(err); + if (err.Fail()) return position_info; + + Smi context_local_count = ContextLocalCount(err); + if (err.Fail()) return position_info; + proper_index += context_local_count.GetValue() * 2; + + int tries = 5; + while (tries > 0 && proper_index < (Length(err).GetValue() - 1)) { + err = Error(); + + Smi maybe_start_position = Get(proper_index, err); + if (err.Success() && maybe_start_position.IsSmi(err)) { + proper_index++; + Smi maybe_end_position = Get(proper_index, err); + if (err.Success() && maybe_end_position.IsSmi(err)) { + position_info.start_position = maybe_start_position.GetValue(); + position_info.end_position = maybe_end_position.GetValue(); + position_info.is_valid = true; + return position_info; + } + } + + tries--; + proper_index++; + } + return position_info; +} + // TODO(indutny): this field is a Smi on 32bit inline int64_t SharedFunctionInfo::ParameterCount(Error& err) { int64_t field = LoadField(v8()->shared_info()->kParameterCountOffset, err); if (err.Fail()) return -1; - field &= 0xffffffff; + field &= 0xffff; return field; } // TODO(indutny): this field is a Smi on 32bit inline int64_t SharedFunctionInfo::StartPosition(Error& err) { + if (v8()->uncompiled_data()->kStartPositionOffset != -1) { + Value maybe_scope_info = name_or_scope_info(err); + if (err.Fail()) return -1; + if (maybe_scope_info.IsScopeInfo(err)) { + ScopeInfo scope_info(maybe_scope_info); + auto position_info = scope_info.MaybePositionInfo(err); + if (err.Fail()) return -1; + if (position_info.is_valid) return position_info.start_position; + } + + Value maybe_uncompiled_data = function_data(err); + if (!maybe_uncompiled_data.IsUncompiledData(err)) { + return 0; + } + + UncompiledData uncompiled_data(maybe_uncompiled_data); + return uncompiled_data.start_position(err); + } + int64_t field = LoadField(v8()->shared_info()->kStartPositionOffset, err); if (err.Fail()) return -1; @@ -397,6 +554,26 @@ inline int64_t SharedFunctionInfo::StartPosition(Error& err) { // TODO (hhellyer): as above, this field is different on 32bit. inline int64_t SharedFunctionInfo::EndPosition(Error& err) { + if (v8()->uncompiled_data()->kEndPositionOffset != -1) { + Value maybe_scope_info = name_or_scope_info(err); + if (err.Fail()) return -1; + if (maybe_scope_info.IsScopeInfo(err)) { + ScopeInfo scope_info(maybe_scope_info); + auto position_info = scope_info.MaybePositionInfo(err); + if (err.Fail()) return -1; + if (position_info.is_valid) return position_info.end_position; + } + + Value maybe_uncompiled_data = function_data(err); + if (!maybe_uncompiled_data.IsUncompiledData(err)) { + err = Error::Failure("Couldn't get ScopeInfo"); + return -1; + } + + UncompiledData uncompiled_data(maybe_uncompiled_data); + return uncompiled_data.end_position(err); + } + int64_t field = LoadField(v8()->shared_info()->kEndPositionOffset, err); if (err.Fail()) return -1; @@ -657,6 +834,9 @@ inline Smi ScopeInfo::ParameterCount(Error& err) { } inline Smi ScopeInfo::StackLocalCount(Error& err) { + if (v8()->scope_info()->kStackLocalCountOffset == -1) { + return Smi(v8(), 0); + } return FixedArray::Get(v8()->scope_info()->kStackLocalCountOffset, err); } @@ -665,24 +845,41 @@ inline Smi ScopeInfo::ContextLocalCount(Error& err) { err); } -inline String ScopeInfo::ContextLocalName(int index, int param_count, - int stack_count, Error& err) { - int proper_index = index + stack_count + 1 + param_count; - proper_index += v8()->scope_info()->kVariablePartIndex; +inline int ScopeInfo::ContextLocalIndex(Error& err) { + int context_local_index = v8()->scope_info()->kVariablePartIndex; + + if (v8()->scope_info()->kEmbeddedParamAndStackLocals) { + Smi param_count = ParameterCount(err); + if (err.Fail()) return -1; + context_local_index += param_count.GetValue() + 1; + + Smi stack_local = StackLocalCount(err); + if (err.Fail()) return -1; + context_local_index += stack_local.GetValue(); + } + return context_local_index; +} + +inline String ScopeInfo::ContextLocalName(int index, Error& err) { + int proper_index = ContextLocalIndex(err) + index; + if (err.Fail()) return String(); return FixedArray::Get(proper_index, err); } inline HeapObject ScopeInfo::MaybeFunctionName(Error& err) { - int proper_index = v8()->scope_info()->kVariablePartIndex + - ParameterCount(err).GetValue() + 1 + - StackLocalCount(err).GetValue() + - (ContextLocalCount(err).GetValue() * 2); + int proper_index = ContextLocalIndex(err); + if (err.Fail()) return HeapObject(); + + Smi context_local_count = ContextLocalCount(err); + if (err.Fail()) return HeapObject(); + proper_index += context_local_count.GetValue() * 2; + // NOTE(mmarchini): FunctionName can be stored either in the first, second or // third slot after ContextLocalCount. Since there are missing postmortem // metadata to determine in which slot its being stored for the present // ScopeInfo, we try to find it heuristically. int tries = 3; - while (tries > 0) { + while (tries > 0 && proper_index < Length(err).GetValue()) { err = Error(); HeapObject maybe_function_name = diff --git a/src/llv8.cc b/src/llv8.cc index e07d2811..014d407b 100644 --- a/src/llv8.cc +++ b/src/llv8.cc @@ -39,6 +39,7 @@ void LLV8::Load(SBTarget target) { js_array.Assign(target, &common); js_function.Assign(target, &common); shared_info.Assign(target, &common); + uncompiled_data.Assign(target, &common); code.Assign(target, &common); scope_info.Assign(target, &common); context.Assign(target, &common); @@ -361,8 +362,8 @@ std::string SharedFunctionInfo::ProperName(Error& err) { std::string res = name.ToString(err); if (err.Fail() || res.empty()) { - Value inferred = InferredName(err); - if (err.Fail()) return std::string(); + Value inferred = GetInferredName(err); + if (err.Fail() || inferred.raw() == -1) return std::string(); // Function may not have inferred name if (!inferred.IsHoleOrUndefined(err) && !err.Fail()) @@ -378,7 +379,7 @@ std::string SharedFunctionInfo::ProperName(Error& err) { std::string SharedFunctionInfo::GetPostfix(Error& err) { Script script = GetScript(err); - if (err.Fail()) return std::string(); + if (err.Fail() || script.raw() == -1) return std::string(); // There is no `Script` for functions created in C++ (and possibly others) int64_t type = script.GetType(err); @@ -766,15 +767,9 @@ Context::Locals::Locals(Context* context, Error& err) { if (err.Fail()) return; scope_info_ = ScopeInfo(scope_obj); - Smi param_count_smi = scope_info_.ParameterCount(err); - if (err.Fail()) return; - Smi stack_count_smi = scope_info_.StackLocalCount(err); - if (err.Fail()) return; Smi local_count_smi = scope_info_.ContextLocalCount(err); if (err.Fail()) return; - param_count_ = param_count_smi.GetValue(); - stack_count_ = stack_count_smi.GetValue(); local_count_ = local_count_smi.GetValue(); } @@ -799,8 +794,7 @@ v8::Value Context::Locals::Iterator::operator*() { } String Context::Locals::Iterator::LocalName(Error& err) { - return outer_->scope_info_.ContextLocalName(current_, outer_->param_count_, - outer_->stack_count_, err); + return outer_->scope_info_.ContextLocalName(current_, err); } Value Context::Locals::Iterator::GetValue(Error& err) { diff --git a/src/llv8.h b/src/llv8.h index d54fce72..d23061f7 100644 --- a/src/llv8.h +++ b/src/llv8.h @@ -57,6 +57,14 @@ class Value { static inline const char* ClassName() { return "Value"; } + // Type check methods + // TODO (mmarchini): Move all ToType methods to class Value to stay coherent + // with V8 API. + inline bool IsSmi(Error& err); + inline bool IsScript(Error& err); + inline bool IsScopeInfo(Error& err); + inline bool IsUncompiledData(Error& err); + protected: LLV8* v8_; int64_t raw_ = 0x0; @@ -162,12 +170,12 @@ class SharedFunctionInfo : public HeapObject { V8_VALUE_DEFAULT_METHODS(SharedFunctionInfo, HeapObject) inline String Name(Error& err); - inline Value InferredName(Error& err); inline Script GetScript(Error& err); inline HeapObject GetScopeInfo(Error& err); inline int64_t ParameterCount(Error& err); inline int64_t StartPosition(Error& err); inline int64_t EndPosition(Error& err); + inline Value GetInferredName(Error& err); std::string ProperName(Error& err); std::string GetPostfix(Error& err); @@ -175,10 +183,23 @@ class SharedFunctionInfo : public HeapObject { private: inline String name(Error& err); + inline Script script(Error& err); + inline HeapObject script_or_debug_info(Error& err); + inline Value inferred_name(Error& err); + inline Value function_data(Error& err); inline HeapObject scope_info(Error& err); inline HeapObject name_or_scope_info(Error& err); }; +class UncompiledData : public HeapObject { + public: + V8_VALUE_DEFAULT_METHODS(UncompiledData, HeapObject) + + inline int32_t start_position(Error& err); + inline int32_t end_position(Error& err); + inline Value inferred_name(Error& err); +}; + class OneByteString : public String { public: V8_VALUE_DEFAULT_METHODS(OneByteString, String) @@ -431,12 +452,19 @@ class ScopeInfo : public FixedArray { public: V8_VALUE_DEFAULT_METHODS(ScopeInfo, FixedArray) + struct PositionInfo { + int64_t start_position; + int64_t end_position; + bool is_valid; + }; + inline Smi ParameterCount(Error& err); inline Smi StackLocalCount(Error& err); inline Smi ContextLocalCount(Error& err); + inline int ContextLocalIndex(Error& err); + inline PositionInfo MaybePositionInfo(Error& err); - inline String ContextLocalName(int index, int param_count, int stack_count, - Error& err); + inline String ContextLocalName(int index, Error& err); inline HeapObject MaybeFunctionName(Error& err); }; @@ -482,8 +510,6 @@ class Context : public FixedArray { private: int local_count_; - int param_count_; - int stack_count_; Context* context_; ScopeInfo scope_info_; }; @@ -572,6 +598,7 @@ class LLV8 { constants::JSArray js_array; constants::JSFunction js_function; constants::SharedInfo shared_info; + constants::UncompiledData uncompiled_data; constants::Code code; constants::ScopeInfo scope_info; constants::Context context; @@ -604,6 +631,7 @@ class LLV8 { friend class String; friend class Script; friend class SharedFunctionInfo; + friend class UncompiledData; friend class Code; friend class JSFunction; friend class OneByteString; diff --git a/test/addon/jsapi-test.js b/test/addon/jsapi-test.js index d067d376..31129c74 100644 --- a/test/addon/jsapi-test.js +++ b/test/addon/jsapi-test.js @@ -85,7 +85,7 @@ function verifyBasicTypes(llnode, t) { const heapTypes = llnode.getHeapTypes(); const basicTypes = [ // basic JS types - '(Array)', '(String)', 'Object', '(Object)', '(ArrayBufferView)', + '(Array)', '(String)', 'Object', '(ArrayBufferView)', // Node types 'process', 'NativeModule' ].sort(); diff --git a/test/plugin/workqueue-test.js b/test/plugin/workqueue-test.js index 9195e41a..7fcb7a93 100644 --- a/test/plugin/workqueue-test.js +++ b/test/plugin/workqueue-test.js @@ -12,21 +12,13 @@ function testWorkqueueCommands(t, sess) { let match = line.match(/ { - t.error(err); - let match = line.match(/ { + sess.wait(/FSReq[a-zA-Z]*/, (err, line) => { t.error(err); - let match = line.match(/