Repository navigation
Fix $try, silent operator and custom functions control flow - #422
Open
Daaisukidayo wants to merge 4 commits into
Open
Daaisukidayo wants to merge 4 commits into
Daaisukidayo wants to merge 4 commits into
Conversation
… errors, the silent operator not working on nested functions and custom functions, $break and $continue in custom functions not affecting loops, and $callLocalFunction ignoring $stop, $break, $continue and errors
…tom-functions # Conflicts: # docs/assets/hierarchy.js # docs/classes/ApplicationCommand.html # docs/classes/ApplicationCommandManager.html # docs/classes/Arg.html # docs/classes/BaseCommand.html # docs/classes/BaseCommandManager.html # docs/classes/BaseEventHandler.html # docs/classes/CompiledFunction.html # docs/classes/Compiler.html # docs/classes/Container.html # docs/classes/Context.html # docs/classes/CooldownManager.html # docs/classes/DiscordEventHandler.html # docs/classes/EventManager.html # docs/classes/FileReader.html # docs/classes/ForgeClient.html # docs/classes/ForgeError.html # docs/classes/ForgeExtension.html # docs/classes/ForgeFunction.html # docs/classes/ForgeFunctionManager.html # docs/classes/FunctionManager.html # docs/classes/Interpreter.html # docs/classes/InviteTracker.html # docs/classes/Logger.html # docs/classes/NativeCommandManager.html # docs/classes/NativeFunction.html # docs/classes/Return.html # docs/classes/ThreadManager.html # docs/classes/VoiceTracker.html # docs/enums/ArgType.html # docs/enums/CalendarType.html # docs/enums/ErrorType.html # docs/enums/HTTPContentType.html # docs/enums/LogPriority.html # docs/enums/LogType.html # docs/enums/OperatorType.html # docs/enums/PrefixMode.html # docs/enums/RegistrationType.html # docs/enums/ReturnType.html # docs/functions/array.html # docs/functions/defineProperties.html # docs/functions/generateMetadata.html # docs/hierarchy.html # docs/interfaces/IApplicationCommandData.html # docs/interfaces/IArg.html # docs/interfaces/IAutomodRuleOptions.html # docs/interfaces/IBaseCommand.html # docs/interfaces/ICommandManagerEvents.html # docs/interfaces/ICompilationResult.html # docs/interfaces/ICompiledCommand.html # docs/interfaces/ICompiledFunction.html # docs/interfaces/ICompiledFunctionConditionField.html # docs/interfaces/ICompiledFunctionField.html # docs/interfaces/IComponentOptions.html # docs/interfaces/IContextCache.html # docs/interfaces/ICooldown.html # docs/interfaces/IEvent.html # docs/interfaces/IExtendedCompilationResult.html # docs/interfaces/IExtendedCompiledFunction.html # docs/interfaces/IExtendedCompiledFunctionConditionField.html # docs/interfaces/IExtendedCompiledFunctionField.html # docs/interfaces/IForgeClientOptions.html # docs/interfaces/IForgeFunction.html # docs/interfaces/IForgeFunctionParam.html # docs/interfaces/IGuildInvite.html # docs/interfaces/IGuildInviter.html # docs/interfaces/IHttpOptions.html # docs/interfaces/ILocalFunctionData.html # docs/interfaces/ILocation.html # docs/interfaces/IMultipleArgResolve.html # docs/interfaces/INativeFunction.html # docs/interfaces/IRawField.html # docs/interfaces/IRawForgeClientOptions.html # docs/interfaces/IRawFunction.html # docs/interfaces/IRawFunctionFieldDefinition.html # docs/interfaces/IRawFunctionMatch.html # docs/interfaces/IRestrictions.html # docs/interfaces/IRunnable.html # docs/interfaces/IScheduledEventOptions.html # docs/interfaces/IStates.html # docs/interfaces/IThreadContext.html # docs/interfaces/IThreadResult.html # docs/interfaces/IThreadTask.html # docs/interfaces/ITrackers.html # docs/types/AnyNativeFunction.html # docs/types/AssertArgs.html # docs/types/ClassInstance.html # docs/types/ClassType.html # docs/types/CommandInteractionTypes.html # docs/types/CommandType.html # docs/types/EnumLike.html # docs/types/ExpectCallback.html # docs/types/ExtendedField.html # docs/types/FilterProperties.html # docs/types/GetArgType.html # docs/types/GetEnum.html # docs/types/GetErrorArgs.html # docs/types/MarkNullable.html # docs/types/MarkRest.html # docs/types/NativeFunctionExecutor.html # docs/types/OverwritePermission.html # docs/types/Properties.html # docs/types/RawExecutableCode.html # docs/types/RecursiveArray.html # docs/types/ResolveFields.html # docs/types/ReturnValue.html # docs/types/Sendable.html # docs/types/States.html # docs/types/UnwrapArg.html # docs/types/UnwrapArgs.html # docs/types/WrappedCode.html # docs/types/WrappedConditionCode.html # docs/variables/COMMAND_INTERACTION_TYPES.html # docs/variables/Conditions.html # docs/variables/NativeEventName.html # docs/variables/Operators.html # metadata/changelogs.json # metadata/enums.json # metadata/functions.json # metadata/translations/en.json
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
$try:$return,$break,$continue, and$stopfunctions are passed to the calling code rather than triggering thecatchblock, JavaScript exceptions are caught and logged viactx.noop, the result of acatchblock correctly handles the!and@[]operators#: Works for functions nested within other functions. A "silent error" is converted into aStopobject containing error information, allowing it to be caught using$tryresolveCodeinstead ofInterpreter.run, errors are returned to the calling code rather than being sent to a channel,$breakand$continuefunctions affect the loop in the calling code$callLocalFunction: Passes$stop,$break,$continue, and errors back to the calling codeReturnValue<ReturnType.Stop>now corresponds to the typeError | null