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 @@ -495,7 +495,11 @@ api.createTermDefinition = ({
495495 // FIXME: remove logging and use a handler
496496 console . warn ( 'WARNING: values beginning with "@" are reserved' +
497497 ' for future use and ignored' , { reverse} ) ;
498- activeCtx . mappings . delete ( term ) ;
498+ if ( previousMapping ) {
499+ activeCtx . mappings . set ( term , previousMapping ) ;
500+ } else {
501+ activeCtx . mappings . delete ( term ) ;
502+ }
499503 return ;
500504 }
501505
@@ -516,7 +520,11 @@ api.createTermDefinition = ({
516520 // FIXME: remove logging and use a handler
517521 console . warn ( 'WARNING: values beginning with "@" are reserved' +
518522 ' for future use and ignored' , { id} ) ;
519- activeCtx . mappings . delete ( term ) ;
523+ if ( previousMapping ) {
524+ activeCtx . mappings . set ( term , previousMapping ) ;
525+ } else {
526+ activeCtx . mappings . delete ( term ) ;
527+ }
520528 return ;
521529 } else if ( id !== term ) {
522530 // expand and add @id mapping
You can’t perform that action at this time.
0 commit comments