Skip to content

Commit 823fa5d

Browse files
committed
Revert "Ensure numeric data is preserved"
This reverts commit 01fd7c6.
1 parent bafc9f0 commit 823fa5d

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,10 +2177,6 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
21772177

21782178
d3DomElement.append('<span class="stringObj">' + literalStr + '</span>');
21792179
}
2180-
else if (obj instanceof Array && obj[0] == "NUMBER-LITERAL") {
2181-
// actually transmitted as a string
2182-
d3DomElement.append('<span class="numberObj">' + obj[1] + '</span>');
2183-
}
21842180
else {
21852181
assert(false);
21862182
}
@@ -3102,7 +3098,7 @@ function structurallyEquivalent(obj1, obj2) {
31023098

31033099
function isPrimitiveType(obj) {
31043100
var typ = typeof obj;
3105-
return ((obj == null) || (typ != "object") || (obj instanceof Array && obj[0] == "NUMBER-LITERAL"));
3101+
return ((obj == null) || (typ != "object"));
31063102
}
31073103

31083104
function getRefID(obj) {

‎v3/pg_encoder.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ def encode(self, dat, get_parent):
137137
# primitive type
138138
if not self.render_heap_primitives and type(dat) in PRIMITIVE_TYPES:
139139
if type(dat) is float:
140-
return ['NUMBER-LITERAL', str(round(dat, FLOAT_PRECISION))]
140+
return round(dat, FLOAT_PRECISION)
141141
else:
142-
return ['NUMBER-LITERAL', str(dat)]
142+
return dat
143143

144144
# compound type - return an object reference and update encoded_heap_objects
145145
else:

0 commit comments

Comments
 (0)