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 = ({
448
448
// FIXME: remove logging and use a handler
449
449
console . warn ( 'WARNING: values beginning with "@" are reserved' +
450
450
' 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
+ }
452
456
return ;
453
457
}
454
458
@@ -469,7 +473,11 @@ api.createTermDefinition = ({
469
473
// FIXME: remove logging and use a handler
470
474
console . warn ( 'WARNING: values beginning with "@" are reserved' +
471
475
' 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
+ }
473
481
return ;
474
482
} else if ( id !== term ) {
475
483
// expand and add @id mapping
You can’t perform that action at this time.
0 commit comments