File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,11 @@ api.createTermDefinition = ({
448448 // FIXME: remove logging and use a handler
449449 console . warn ( 'WARNING: values beginning with "@" are reserved' +
450450 ' for future use and ignored' , { reverse} ) ;
451- activeCtx . mappings . delete ( term ) ;
451+ if ( previousMapping ) {
452+ activeCtx . mappings . set ( term , previousMapping ) ;
453+ } else {
454+ activeCtx . mappings . delete ( term ) ;
455+ }
452456 return ;
453457 }
454458
@@ -469,7 +473,11 @@ api.createTermDefinition = ({
469473 // FIXME: remove logging and use a handler
470474 console . warn ( 'WARNING: values beginning with "@" are reserved' +
471475 ' for future use and ignored' , { id} ) ;
472- activeCtx . mappings . delete ( term ) ;
476+ if ( previousMapping ) {
477+ activeCtx . mappings . set ( term , previousMapping ) ;
478+ } else {
479+ activeCtx . mappings . delete ( term ) ;
480+ }
473481 return ;
474482 } else if ( id !== term ) {
475483 // expand and add @id mapping
You can’t perform that action at this time.
0 commit comments