Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/ortus-solutions-priv…
Browse files Browse the repository at this point in the history
…ate/boxlang into development
  • Loading branch information
bdw429s committed Sep 13, 2023
2 parents 61e6451 + a774e02 commit dbe5c65
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ public Function getFunction() {

/**
* Search for a variable in "nearby" scopes
*
* @param key The key to search for
* @param defaultScope The default scope to use if the key is not found
* @param shallow Whether to search only the "nearby" scopes or all scopes
*
* @return The search result
*/
@Override
public ScopeSearchResult scopeFindNearby( Key key, IScope defaultScope, boolean shallow ) {

Object result = localScope.getRaw( key );
Expand Down Expand Up @@ -98,7 +105,13 @@ public ScopeSearchResult scopeFindNearby( Key key, IScope defaultScope, boolean

/**
* Search for a variable in scopes
*
* @param key The key to search for
* @param defaultScope The default scope to use if the key is not found
*
* @return The search result
*/
@Override
public ScopeSearchResult scopeFind( Key key, IScope defaultScope ) {

// The FunctionBoxContext has no "global" scopes, so just defer to parent
Expand All @@ -120,7 +133,12 @@ public ScopeSearchResult scopeFind( Key key, IScope defaultScope ) {

/**
* Look for a scope by name
*
* @param name The name of the scope to look for
*
* @return The scope reference to use
*/
@Override
public IScope getScope( Key name ) throws ScopeNotFoundException {

// The FunctionBoxContext has no "global" scopes, so just defer to parent
Expand All @@ -137,7 +155,12 @@ public IScope getScope( Key name ) throws ScopeNotFoundException {

/**
* Look for a "nearby" scope by name
*
* @param name The name of the scope to look for
*
* @return The scope reference to use
*/
@Override
public IScope getScopeNearby( Key name ) throws ScopeNotFoundException {
// Check the scopes I know about
if ( name.equals( localScope.getName() ) ) {
Expand All @@ -164,6 +187,7 @@ public IScope getScopeNearby( Key name ) throws ScopeNotFoundException {
*
* @return The Function instance
*/
@Override
public Function findClosestFunction() {
return function;
}
Expand All @@ -173,6 +197,7 @@ public Function findClosestFunction() {
*
* @return The scope reference to use
*/
@Override
public IScope getDefaultAssignmentScope() {
// DIFFERENT FROM CFML ENGINES! Same as Lucee's "local mode"
return localScope;
Expand All @@ -183,6 +208,7 @@ public IScope getDefaultAssignmentScope() {
*
* @return The context to use
*/
@Override
public IBoxContext getFunctionParentContext() {
// If a function is executed inside another function, it uses the parent since there is nothing a function can "see" from inside it's calling function
return getParent();
Expand Down

0 comments on commit dbe5c65

Please sign in to comment.