We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 395c558 commit cfdfd6aCopy full SHA for cfdfd6a
1 file changed
v3/js/pytutor.js
@@ -3107,14 +3107,16 @@ function structurallyEquivalent(obj1, obj2) {
3107
3108
3109
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') {
+ if (obj == null) {
3114
return true;
3115
}
3116
3117
- return ((obj == null) || (typ != "object"));
+ if (typeof obj == "object") {
+ // kludge: 'SPECIAL_FLOAT' objects count as primitives
+ return (obj[0] == 'SPECIAL_FLOAT');
+ else {
3118
+ return true;
3119
+ }
3120
3121
3122
function getRefID(obj) {
0 commit comments