Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fix gs.isGroovyObj with undefineds
Browse files Browse the repository at this point in the history
  • Loading branch information
chiquitinxx committed Jun 19, 2015
1 parent 824ed18 commit b2f701b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/main/resources/META-INF/resources/grooscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
},
getMetaClass : function() {
return gs.metaClass(this);
}
},
clazz: {}
};

function applyBaseClassFunctions(item) {
Expand Down Expand Up @@ -2656,7 +2657,7 @@
////////////////////////////////////////////////////////////
gs.stringBuffer = function() {

var object = gs.inherit(gs.baseClass,'StringBuffer');
var object = gs.inherit(gs.baseClass, 'StringBuffer');
object.value = '';

if (arguments.length == 1 && typeof arguments[0] === 'string') {
Expand Down Expand Up @@ -2860,11 +2861,7 @@
};

gs.isGroovyObj = function(maybeGroovyObject) {
return maybeGroovyObject !== null &&
(maybeGroovyObject.withz !== undefined &&
typeof(maybeGroovyObject.withz) === "function") ||
(maybeGroovyObject.clazz !== undefined &&
maybeGroovyObject.clazz.name == 'java.util.LinkedHashMap');
return maybeGroovyObject !== null && maybeGroovyObject !== undefined && maybeGroovyObject.clazz !== undefined;
};

gs.execStatic = function(obj, methodName, thisObject, params) {
Expand Down
Loading

0 comments on commit b2f701b

Please sign in to comment.