Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from xpring-eng/shim_js
Browse files Browse the repository at this point in the history
Update JavaScript Loader for new JavaScript format
  • Loading branch information
keefertaylor committed Nov 7, 2019
2 parents 21db350 + 1691553 commit 550cf80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions XpringKit/JavaScript/XRPJavaScriptLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal enum XRPJavaScriptLoader {

/// Load a class, parameter or function from the default entry point on the given JSContext.
///
/// This method loads value from `EntryPoint.default.<value>`.
/// This method loads value from `EntryPoint.<value>`.
///
/// - Note: This function will crash if the requested resource does not exist.
///
Expand All @@ -62,13 +62,12 @@ internal enum XRPJavaScriptLoader {
public static func load(_ resourceName: String, from context: JSContext) -> JSValue {
guard
let entrypoint = context.objectForKeyedSubscript("EntryPoint"),
let `default` = entrypoint.objectForKeyedSubscript("default"),
!`default`.isUndefined
!entrypoint.isUndefined
else {
fatalError(LoaderErrors.missingEntrypoint)
}

return load(resourceName, from: `default`)
return load(resourceName, from: entrypoint)
}

/// Load a class, parameter or function as a keyed subscript from the given value.
Expand Down

0 comments on commit 550cf80

Please sign in to comment.