From 2b43e13414a6c84e6ba2cd4e908695611878c84e Mon Sep 17 00:00:00 2001 From: Matheus Marchini Date: Fri, 4 Oct 2019 08:44:10 -0700 Subject: [PATCH] src: update UncompiledData types constants Ref: https://github.com/nodejs/llnode/issues/255 --- src/llv8-constants.cc | 12 ++++++++---- src/llv8-constants.h | 4 ++-- src/llv8-inl.h | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/llv8-constants.cc b/src/llv8-constants.cc index 0afe8f66..2f1f4684 100644 --- a/src/llv8-constants.cc +++ b/src/llv8-constants.cc @@ -539,11 +539,15 @@ void Types::Load() { kSharedFunctionInfoType = LoadConstant("type_SharedFunctionInfo__SHARED_FUNCTION_INFO_TYPE"); kUncompiledDataWithoutPreParsedScopeType = LoadConstant( - "type_UncompiledDataWithoutPreParsedScope__UNCOMPILED_DATA_WITHOUT_PRE_" - "PARSED_SCOPE_TYPE"); + {"type_UncompiledDataWithoutPreParsedScope__UNCOMPILED_DATA_WITHOUT_PRE_" + "PARSED_SCOPE_TYPE", + "type_UncompiledDataWithoutPreparseData__UNCOMPILED_DATA_WITHOUT_" + "PREPARSE_DATA_TYPE"}); kUncompiledDataWithPreParsedScopeType = LoadConstant( - "type_UncompiledDataWithPreParsedScope__UNCOMPILED_DATA_WITH_PRE_PARSED_" - "SCOPE_TYPE"); + {"type_UncompiledDataWithPreParsedScope__UNCOMPILED_DATA_WITH_PRE_PARSED_" + "SCOPE_TYPE", + "type_UncompiledDataWithPreparseData__UNCOMPILED_DATA_WITH_" + "PREPARSE_DATA_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 7ebc8211..cf297419 100644 --- a/src/llv8-constants.h +++ b/src/llv8-constants.h @@ -524,8 +524,8 @@ class Types : public Module { int64_t kJSRegExpType; int64_t kJSDateType; int64_t kSharedFunctionInfoType; - int64_t kUncompiledDataWithoutPreParsedScopeType; - int64_t kUncompiledDataWithPreParsedScopeType; + Constant kUncompiledDataWithoutPreParsedScopeType; + Constant kUncompiledDataWithPreParsedScopeType; int64_t kScriptType; int64_t kScopeInfoType; int64_t kSymbolType; diff --git a/src/llv8-inl.h b/src/llv8-inl.h index f52b79e8..beda40cb 100644 --- a/src/llv8-inl.h +++ b/src/llv8-inl.h @@ -144,8 +144,8 @@ inline bool Value::IsUncompiledData(Error& err) { int64_t type = heap_object.GetType(err); if (err.Fail()) return false; - return type == v8()->types()->kUncompiledDataWithoutPreParsedScopeType || - type == v8()->types()->kUncompiledDataWithPreParsedScopeType; + return type == *v8()->types()->kUncompiledDataWithoutPreParsedScopeType || + type == *v8()->types()->kUncompiledDataWithPreParsedScopeType; }