Commit e883afc
committed
fix(globals): Use shallow copy to update the globals.params / $state.params object
Previously, the `globals.params` object was updated using a deep copy.
This causes problems when object-type parameter values aren't cloneable.
Now, the parameter values are copied to the `globals.params` object using a shallow copy, i.e., `Object.assign`.
This is consistent with parameter handling in the `PathNode` code also.
If this commit is causing problems, it is likely that app code is mutating
the existing object parameters and then calling `state.go` with the mutated
parameters. Recommend making a clone of the params before calling `state.go`.
Closes #741 parent 2f1ae9a commit e883afc
3 files changed
+23
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
528 | 527 | | |
529 | 528 | | |
530 | 529 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | 530 | | |
535 | | - | |
| 531 | + | |
536 | 532 | | |
537 | 533 | | |
538 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
429 | 450 | | |
430 | 451 | | |
431 | 452 | | |
| |||
952 | 973 | | |
953 | 974 | | |
954 | 975 | | |
955 | | - | |
| 976 | + | |
0 commit comments