Skip to content

Commit

Permalink
Merge pull request #3989 from bryan-m-hughes/timob-13116
Browse files Browse the repository at this point in the history
[TIMOB-13116] Fixed a bug in toString in declare
  • Loading branch information
cb1kenobi committed Mar 19, 2013
2 parents e35e591 + 41a0d6a commit bd17e60
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mobileweb/titanium/Ti/_/declare.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ define(["Ti/_", "Ti/_/lang"], function(_, lang) {
var a = arguments,
args = a,
a0 = a[0],
f, i, m, p,
f, i, m,
l = bases.length,
preArgs,
dc = this.declaredClass;

classCounters[dc] || (classCounters[dc] = 0);
this.widgetId = dc + ":" + (classCounters[dc]++);
if (dc) {
classCounters[dc] || (classCounters[dc] = 0);
this.widgetId = dc + ":" + (classCounters[dc]++);
}

// 1) call two types of the preamble
if (ctorSpecial && (a0 && a0.preamble || this.preamble)) {
Expand Down Expand Up @@ -148,7 +150,7 @@ define(["Ti/_", "Ti/_/lang"], function(_, lang) {

// add the toString() function for all our objects
this.toString === objProto.toString && (this.toString = function() {
return "[object " + dc.replace(/\./g, '') + "]";
return "[object " + (dc ? dc.replace(/\./g, '') : 'Object') + "]";
});

// 4) continue the original ritual: call the postscript
Expand Down

0 comments on commit bd17e60

Please sign in to comment.