Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Module Loader runtime objects #1472

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Parser/rterrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,6 @@ RT_ERROR_MSG(JSERR_InvalidHint, 5658, "%s: invalid hint", "invalid hint", kjstTy

RT_ERROR_MSG(JSERR_This_NeedNamespace, 5659, "%s: 'this' is not a Module Namespace object", "Module Namespace object expected", kjstTypeError, JSERR_This_NeedNamespace) // {Locked="\'this\'"}
RT_ERROR_MSG(JSERR_This_NeedListIterator, 5660, "%s: 'this' is not a List Iterator object", "List Iterator expected", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_CannotCallOrConstruct, 5661, "%s is not intended to be called as a function or as a constructor", "Not intended to be called as a function or as a constructor", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_ModuleNotFound, 5662, "", "Module could not be found", kjstTypeError, 0)
RT_ERROR_MSG(JSERR_InvalidModuleStatusStage, 5663, "", "Invalid value for ModuleStatus stage", kjstTypeError, 0)
20 changes: 20 additions & 0 deletions lib/Runtime/Base/JnDirectFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ ENTRY_SYMBOL(_symbolSpecies, _u("[Symbol.species]"))
ENTRY_SYMBOL(_symbolToPrimitive, _u("Symbol.toPrimitive"))
ENTRY_SYMBOL(_symbolToStringTag, _u("Symbol.toStringTag"))
ENTRY_SYMBOL(_symbolUnscopables, _u("Symbol.unscopables"))
ENTRY_SYMBOL(_symbolResolve, _u("Reflect.Loader.resolve"))
ENTRY_SYMBOL(_symbolFetch, _u("Reflect.Loader.fetch"))
ENTRY_SYMBOL(_symbolTranslate, _u("Reflect.Loader.translate"))
ENTRY_SYMBOL(_symbolInstantiate, _u("Reflect.Loader.instantiate"))

// math functions must remain contiguous for quick modification check
ENTRY(abs)
Expand Down Expand Up @@ -658,6 +662,22 @@ ENTRY(enqueueTask)
ENTRY(Common)
ENTRY(Promise)
ENTRY(MissingProperty)
ENTRY(Registry)
ENTRY(registry)
ENTRY(Loader)
ENTRY(import)
ENTRY(stage)
ENTRY(originalKey)
ENTRY(module)
ENTRY(error)
ENTRY(dependencies)
ENTRY(result)
ENTRY(Module)
ENTRY(Status)
ENTRY(fetch)
ENTRY(translate)
ENTRY(instantiate)
ENTRY(evaluate)

// These are ES5/6/7+ builtins that are tracked for telemetry purposes, but currently not implemented by Chakra or are otherwise special.
// IMPORTANT NOTE: See notes at top of this file regarding GenByteCode and test failures after changing this list.
Expand Down
6 changes: 0 additions & 6 deletions lib/Runtime/Language/ModuleNamespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
//-------------------------------------------------------------------------------------------------------

#include "RuntimeLanguagePch.h"
#include "Types/PropertyIndexRanges.h"
#include "Types/SimpleDictionaryPropertyDescriptor.h"
#include "Types/SimpleDictionaryTypeHandler.h"
#include "Types/NullTypeHandler.h"
#include "ModuleNamespace.h"
#include "ModuleNamespaceEnumerator.h"

namespace Js
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Runtime/Language/RuntimeLanguagePch.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "Library/JavascriptGenerator.h"
#include "Library/StackScriptFunction.h"
#include "Library/HostObjectBase.h"
#include "Language/ModuleNamespace.h"
#include "Language/ModuleNamespaceEnumerator.h"

#ifdef ENABLE_MUTATION_BREAKPOINT
// REVIEW: ChakraCore Dependency
Expand Down
6 changes: 6 additions & 0 deletions lib/Runtime/Library/Chakra.Runtime.Library.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
<ClCompile Include="$(MSBuildThisFileDirectory)IntlEngineInterfaceExtensionObject.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptErrorDebug.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptListIterator.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptRegistry.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptLoader.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptModuleStatus.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\InternalPropertyList.h" />
Expand All @@ -167,6 +170,9 @@
<ClInclude Include="IntlEngineInterfaceExtensionObject.h" />
<ClInclude Include="JavascriptErrorDebug.h" />
<ClInclude Include="JavascriptListIterator.h" />
<ClInclude Include="JavascriptLoader.h" />
<ClInclude Include="JavascriptRegistry.h" />
<ClInclude Include="JavascriptModuleStatus.h" />
<ClInclude Include="JavascriptSimdObject.h" />
<ClInclude Include="JavascriptSimdType.h" />
<ClInclude Include="JavascriptSimdFloat32x4.h" />
Expand Down
6 changes: 6 additions & 0 deletions lib/Runtime/Library/Chakra.Runtime.Library.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptSimdBool8x16.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)SimdBool8x16Lib.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptListIterator.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptRegistry.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptLoader.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JavascriptModuleStatus.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\InternalPropertyList.h" />
Expand Down Expand Up @@ -242,6 +245,9 @@
<ClInclude Include="SimdBool16x8Lib.h" />
<ClInclude Include="SimdBool8x16Lib.h" />
<ClInclude Include="JavascriptListIterator.h" />
<ClInclude Include="JavascriptRegistry.h" />
<ClInclude Include="JavascriptLoader.h" />
<ClInclude Include="JavascriptModuleStatus.h" />
</ItemGroup>
<ItemGroup>
<None Include="ConcatString.inl" />
Expand Down
Loading