Skip to content

Commit cfdfd6a

Browse files
committed
tricky!
1 parent 395c558 commit cfdfd6a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

v3/js/pytutor.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,14 +3107,16 @@ function structurallyEquivalent(obj1, obj2) {
31073107

31083108

31093109
function isPrimitiveType(obj) {
3110-
var typ = typeof obj;
3111-
3112-
// kludge: 'SPECIAL_FLOAT' objects count as primitives
3113-
if (typ == "object" && obj[0] == 'SPECIAL_FLOAT') {
3110+
if (obj == null) {
31143111
return true;
31153112
}
31163113

3117-
return ((obj == null) || (typ != "object"));
3114+
if (typeof obj == "object") {
3115+
// kludge: 'SPECIAL_FLOAT' objects count as primitives
3116+
return (obj[0] == 'SPECIAL_FLOAT');
3117+
else {
3118+
return true;
3119+
}
31183120
}
31193121

31203122
function getRefID(obj) {

0 commit comments

Comments
 (0)