-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: letで定義した変数が上書きできてしまうのを修正 (#329)
* letをイミュータブルにした * npm run api * CHANGELOGに追記 * 命名を変更 * stdを戻した
- Loading branch information
Showing
6 changed files
with
99 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Value } from './value.js'; | ||
|
||
export type Variable = | ||
| { | ||
isMutable: false | ||
readonly value: Value | ||
} | ||
| { | ||
isMutable: true | ||
value: Value | ||
} | ||
|
||
export const Variable = { | ||
mut(value: Value): Variable { | ||
return { | ||
isMutable: true, | ||
value, | ||
}; | ||
}, | ||
const(value: Value): Variable { | ||
return { | ||
isMutable: false, | ||
value, | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters