From 119e11cfe2c069b5c28df4b6ec049a8c2cfe112e Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Mon, 20 Sep 2021 09:19:05 +0200 Subject: [PATCH] Fixed: Allow 'await' for loading a bundle with the method 'loadWithDelegate:' --- Foundation/CPBundle.j | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Foundation/CPBundle.j b/Foundation/CPBundle.j index fa752574a..7f647e8f3 100644 --- a/Foundation/CPBundle.j +++ b/Foundation/CPBundle.j @@ -207,7 +207,10 @@ var CPBundlesForURLStrings = { }; CPLog.error("Could not find bundle: " + self); }); - _bundle.load(YES); + // Return the answer so it is possible to do 'await' on this 'loadWithDelegate:' method as the + // load function will return a Promise. It is still possible to not do 'await' on this method + // and that gives us the old behaviour. + return _bundle.load(YES); } - (CPArray)staticResourceURLs