File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -844,6 +844,42 @@ export class Lively4URLScheme extends Scheme {
844844 }
845845}
846846
847+ export class GSScheme_Stub extends Scheme {
848+
849+ get scheme ( ) {
850+ return "gs" ;
851+ }
852+
853+ resolve ( ) {
854+ return true
855+ }
856+
857+ static async delegatee ( ) {
858+ if ( this . _delegatee ) {
859+ return this . _delegatee ;
860+ } else {
861+ return this . _delegateePromise = this . _delegateePromise || new Promise ( resolve => this . _delegateeResolve = resolve ) ;
862+ }
863+ }
864+
865+ static delegateTo ( Scheme ) {
866+ this . _delegatee = Scheme ;
867+ this . _delegateeResolve && this . _delegateeResolve ( this . _delegatee ) ;
868+ }
869+
870+ async holdOff ( methodName , ...args ) {
871+ const NewScheme = await GSScheme_Stub . delegatee ( ) ;
872+ this . migrateTo ( NewScheme ) ;
873+ return this [ methodName ] ( ...args ) ;
874+ }
875+
876+ async GET ( ...args ) { return this . holdOff ( 'GET' , ...args ) ; }
877+ async PUT ( ...args ) { return this . holdOff ( 'PUT' , ...args ) ; }
878+ async OPTIONS ( ...args ) { return this . holdOff ( 'OPTIONS' , ...args ) ; }
879+ async POST ( ...args ) { return this . holdOff ( 'POST' , ...args ) ; }
880+ async DELETE ( ...args ) { return this . holdOff ( 'DELETE' , ...args ) ; }
881+ }
882+
847883
848884export default class PolymorphicIdentifier {
849885
@@ -868,6 +904,7 @@ export default class PolymorphicIdentifier {
868904 DateScheme ,
869905 BooleanScheme ,
870906 Lively4URLScheme ,
907+ GSScheme_Stub ,
871908 ] . forEach ( scheme => this . register ( scheme ) ) ;
872909 }
873910
You can’t perform that action at this time.
0 commit comments