1 /* See license.txt for terms of usage */ 2 3 define([], function() { 4 5 // ********************************************************************************************* // 6 // Constants 7 8 function SourceLink(url, line, type, object, instance, col) 9 { 10 this.href = url; 11 this.instance = instance; 12 this.line = line; 13 this.type = type; 14 this.object = object; 15 this.col = col; 16 }; 17 18 SourceLink.prototype = 19 { 20 toString: function() 21 { 22 return this.href+"@"+(this.line || '?'); 23 }, 24 25 toJSON: function() // until 3.1... 26 { 27 return "{\"href\":\""+this.href+"\", "+ 28 (this.line?("\"line\":"+this.line+","):"")+ 29 (this.type?(" \"type\":\""+this.type+"\","):"")+ 30 "}"; 31 } 32 }; 33 34 // ********************************************************************************************* // 35 // Registration 36 37 return { 38 SourceLink: SourceLink 39 } 40 41 // ********************************************************************************************* // 42 }); 43