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 = ({
495
495
// FIXME: remove logging and use a handler
496
496
console . warn ( 'WARNING: values beginning with "@" are reserved' +
497
497
' 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
+ }
499
503
return ;
500
504
}
501
505
@@ -516,7 +520,11 @@ api.createTermDefinition = ({
516
520
// FIXME: remove logging and use a handler
517
521
console . warn ( 'WARNING: values beginning with "@" are reserved' +
518
522
' 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
+ }
520
528
return ;
521
529
} else if ( id !== term ) {
522
530
// expand and add @id mapping
You can’t perform that action at this time.
0 commit comments