Skip to content

Commit 4b5911b

Browse files
DiligentPenguinnRichDom2185sayomakimartin-henz
authored
CSE Machine: Fix display bug when scanning out declarations (frontend) (#2756)
* Update CSE-related names due to recent name changes in js-slang. These changes may not be exhaustive but are sufficient to get the frontend work. * Change ec-evaluator to cse-machine * Fix eslint errors * Revert "Fix eslint errors" This reverts commit 9b32357. * Revert "Update CSE-related names due to recent name changes in js-slang. These changes may not be exhaustive but are sufficient to get the frontend work." This reverts commit c047151. * Revert "Fix eslint errors" This reverts commit 9b32357. * Display : or := based on the key description * revole conflicts * Fix format * bumping js-slang --------- Co-authored-by: Richard Dominick <[email protected]> Co-authored-by: sayomaki <[email protected]> Co-authored-by: henz <[email protected]>
1 parent b6386bd commit 4b5911b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"flexboxgrid": "^6.3.1",
4949
"flexboxgrid-helpers": "^1.1.3",
5050
"hastscript": "^9.0.0",
51-
"js-slang": "^1.0.38",
51+
"js-slang": "^1.0.39",
5252
"js-yaml": "^4.1.0",
5353
"konva": "^9.2.0",
5454
"lodash": "^4.17.21",

src/features/envVisualizer/compactComponents/Frame.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ export class Frame extends Visible implements IHoverable {
112112
entries.push(...dummyEntries);
113113

114114
for (const [key, data] of entries) {
115-
const currBinding: Binding = new Binding(key, data.value, this, prevBinding, !data.writable);
115+
// If the value is unassigned, retrieve declaration type from its description, otherwise, retrieve directly from the data's property
116+
const constant =
117+
this.environment.head[key].description === 'const declaration' || !data.writable;
118+
const currBinding: Binding = new Binding(key, data.value, this, prevBinding, constant);
116119
this.bindings.push(currBinding);
117120
prevBinding = currBinding;
118121
totalWidth = Math.max(totalWidth, currBinding.width() + CompactConfig.FramePaddingX);

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -8327,10 +8327,10 @@ [email protected], js-sdsl@^4.1.4:
83278327
resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711"
83288328
integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==
83298329

8330-
js-slang@^1.0.38:
8331-
version "1.0.38"
8332-
resolved "https://registry.yarnpkg.com/js-slang/-/js-slang-1.0.38.tgz#2e94e54b097d7f3748026de191bc306410bd1a4c"
8333-
integrity sha512-rv4Zdxq+QuBt8I8Dr65TbKXe0/G5VZ7ggqpDf8k9o2gw4PLtXc5NYjWhtPC6aO0+wOStd0Gi3oPOEaMRP+5X9w==
8330+
js-slang@^1.0.39:
8331+
version "1.0.39"
8332+
resolved "https://registry.yarnpkg.com/js-slang/-/js-slang-1.0.39.tgz#383cc8fbec96ac7e7e1955ed397357aef04a0a47"
8333+
integrity sha512-gzRsAWv2mStui8VBsgWUdzx3cKbaDAOqbulC27c4MO2Hp5ElRCcOqVIHDEdMXJXHjn9K3A85SEVHWBCZBJT+Nw==
83348334
dependencies:
83358335
"@babel/parser" "^7.19.4"
83368336
"@joeychenofficial/alt-ergo-modified" "^2.4.0"

0 commit comments

Comments
 (0)