Skip to content

Commit

Permalink
Never make argument-less functions instantiated
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jul 1, 2013
1 parent 25e34cc commit 50498ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/infer.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
});

var getInstance = exports.getInstance = function(obj, ctor) {
if (ctor == false) return new Obj(obj);
if (ctor === false) return new Obj(obj);

if (!ctor) ctor = obj.hasCtor;
if (!obj.instances) obj.instances = [];
Expand Down Expand Up @@ -674,7 +674,7 @@

function maybeTagAsInstantiated(node, scope) {
var score = scope.fnType.instantiateScore;
if (score && nodeSmallerThan(node, score * 5)) {
if (scope.fnType.args.length && score && nodeSmallerThan(node, score * 5)) {
maybeInstantiate(scope.prev, score / 2);
setFunctionInstantiated(node, scope);
return true;
Expand Down

0 comments on commit 50498ca

Please sign in to comment.