Skip to content

Commit c3f2364

Browse files
committed
Updated Jsonix scripts. Fixes #210.
1 parent 9461ab0 commit c3f2364

File tree

8 files changed

+25
-22
lines changed

8 files changed

+25
-22
lines changed

dist/Jsonix-all.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ Jsonix.XML.QName.key = function(namespaceURI, localPart) {
921921
Jsonix.Util.Ensure.ensureString(localPart);
922922
if (namespaceURI) {
923923
var colonPosition = localPart.indexOf(':');
924+
var localName;
924925
if (colonPosition > 0 && colonPosition < localPart.length) {
925926
localName = localPart.substring(colonPosition + 1);
926927
} else {
@@ -4901,7 +4902,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49014902
};
49024903
return new Jsonix.XML.Calendar(data);
49034904
}
4904-
throw new Error('Value [' + value + '] does not match the xs:date pattern.');
4905+
throw new Error('Value [' + text + '] does not match the xs:date pattern.');
49054906
},
49064907
parseDate : function(text, context, input, scope) {
49074908
Jsonix.Util.Ensure.ensureString(text);
@@ -4916,7 +4917,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49164917
};
49174918
return new Jsonix.XML.Calendar(data);
49184919
}
4919-
throw new Error('Value [' + value + '] does not match the xs:date pattern.');
4920+
throw new Error('Value [' + text + '] does not match the xs:date pattern.');
49204921
},
49214922
parseTime : function(text, context, input, scope) {
49224923
Jsonix.Util.Ensure.ensureString(text);
@@ -4932,7 +4933,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49324933
};
49334934
return new Jsonix.XML.Calendar(data);
49344935
}
4935-
throw new Error('Value [' + value + '] does not match the xs:time pattern.');
4936+
throw new Error('Value [' + text + '] does not match the xs:time pattern.');
49364937
},
49374938
parseTimezoneString : function(text) {
49384939
// (('+' | '-') hh ':' mm) | 'Z'
@@ -4955,7 +4956,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49554956
var minute = parseInt(results[5], 10);
49564957
return sign * (hour * 60 + minute);
49574958
}
4958-
throw new Error('Value [' + value + '] does not match the timezone pattern.');
4959+
throw new Error('Value [' + text + '] does not match the timezone pattern.');
49594960
}
49604961
},
49614962
print : function(value, context, output, scope) {

dist/Jsonix-min.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,12 @@ return new Jsonix.XML.QName(e,f,g)
331331
Jsonix.XML.QName.fromObjectOrString=function(f,d,e){if(Jsonix.Util.Type.isString(f)){return Jsonix.XML.QName.fromString(f,d,e)
332332
}else{return Jsonix.XML.QName.fromObject(f)
333333
}};
334-
Jsonix.XML.QName.key=function(f,e){Jsonix.Util.Ensure.ensureString(e);
335-
if(f){var d=e.indexOf(":");
336-
if(d>0&&d<e.length){localName=e.substring(d+1)
337-
}else{localName=e
338-
}return"{"+f+"}"+localName
334+
Jsonix.XML.QName.key=function(g,e){Jsonix.Util.Ensure.ensureString(e);
335+
if(g){var h=e.indexOf(":");
336+
var f;
337+
if(h>0&&h<e.length){f=e.substring(h+1)
338+
}else{f=e
339+
}return"{"+g+"}"+f
339340
}else{return e
340341
}};
341342
Jsonix.XML.Calendar=Jsonix.Class({year:NaN,month:NaN,day:NaN,hour:NaN,minute:NaN,second:NaN,fractionalSecond:NaN,timezone:NaN,date:null,initialize:function(f){Jsonix.Util.Ensure.ensureObject(f);
@@ -1939,19 +1940,19 @@ var k=new RegExp("^"+Jsonix.Schema.XSD.Calendar.DATETIME_PATTERN+"$");
19391940
var h=j.match(k);
19401941
if(h!==null){var l={year:parseInt(h[1],10),month:parseInt(h[5],10),day:parseInt(h[7],10),hour:parseInt(h[9],10),minute:parseInt(h[10],10),second:parseInt(h[11],10),fractionalSecond:(h[12]?parseFloat(h[12]):0),timezone:this.parseTimezoneString(h[14])};
19411942
return new Jsonix.XML.Calendar(l)
1942-
}throw new Error("Value ["+value+"] does not match the xs:date pattern.")
1943+
}throw new Error("Value ["+j+"] does not match the xs:date pattern.")
19431944
},parseDate:function(j,n,i,m){Jsonix.Util.Ensure.ensureString(j);
19441945
var k=new RegExp("^"+Jsonix.Schema.XSD.Calendar.DATE_PATTERN+"$");
19451946
var h=j.match(k);
19461947
if(h!==null){var l={year:parseInt(h[1],10),month:parseInt(h[5],10),day:parseInt(h[7],10),timezone:this.parseTimezoneString(h[9])};
19471948
return new Jsonix.XML.Calendar(l)
1948-
}throw new Error("Value ["+value+"] does not match the xs:date pattern.")
1949+
}throw new Error("Value ["+j+"] does not match the xs:date pattern.")
19491950
},parseTime:function(j,n,i,m){Jsonix.Util.Ensure.ensureString(j);
19501951
var k=new RegExp("^"+Jsonix.Schema.XSD.Calendar.TIME_PATTERN+"$");
19511952
var h=j.match(k);
19521953
if(h!==null){var l={hour:parseInt(h[1],10),minute:parseInt(h[2],10),second:parseInt(h[3],10),fractionalSecond:(h[4]?parseFloat(h[4]):0),timezone:this.parseTimezoneString(h[6])};
19531954
return new Jsonix.XML.Calendar(l)
1954-
}throw new Error("Value ["+value+"] does not match the xs:time pattern.")
1955+
}throw new Error("Value ["+j+"] does not match the xs:time pattern.")
19551956
},parseTimezoneString:function(i){if(!Jsonix.Util.Type.isString(i)){return NaN
19561957
}else{if(i===""){return NaN
19571958
}else{if(i==="Z"){return 0
@@ -1963,7 +1964,7 @@ if(l!==null){var g=l[1]==="+"?1:-1;
19631964
var h=parseInt(l[4],10);
19641965
var k=parseInt(l[5],10);
19651966
return g*(h*60+k)
1966-
}throw new Error("Value ["+value+"] does not match the timezone pattern.")
1967+
}throw new Error("Value ["+i+"] does not match the timezone pattern.")
19671968
}}}}}},print:function(g,e,f,h){Jsonix.Util.Ensure.ensureObject(g);
19681969
if(Jsonix.Util.NumberUtils.isInteger(g.year)&&Jsonix.Util.NumberUtils.isInteger(g.month)&&Jsonix.Util.NumberUtils.isInteger(g.day)&&Jsonix.Util.NumberUtils.isInteger(g.hour)&&Jsonix.Util.NumberUtils.isInteger(g.minute)&&Jsonix.Util.NumberUtils.isInteger(g.second)){return this.printDateTime(g)
19691970
}else{if(Jsonix.Util.NumberUtils.isInteger(g.year)&&Jsonix.Util.NumberUtils.isInteger(g.month)&&Jsonix.Util.NumberUtils.isInteger(g.day)){return this.printDate(g)

nodejs/scripts/jsonix.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ Jsonix.XML.QName.key = function(namespaceURI, localPart) {
921921
Jsonix.Util.Ensure.ensureString(localPart);
922922
if (namespaceURI) {
923923
var colonPosition = localPart.indexOf(':');
924+
var localName;
924925
if (colonPosition > 0 && colonPosition < localPart.length) {
925926
localName = localPart.substring(colonPosition + 1);
926927
} else {
@@ -4901,7 +4902,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49014902
};
49024903
return new Jsonix.XML.Calendar(data);
49034904
}
4904-
throw new Error('Value [' + value + '] does not match the xs:date pattern.');
4905+
throw new Error('Value [' + text + '] does not match the xs:date pattern.');
49054906
},
49064907
parseDate : function(text, context, input, scope) {
49074908
Jsonix.Util.Ensure.ensureString(text);
@@ -4916,7 +4917,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49164917
};
49174918
return new Jsonix.XML.Calendar(data);
49184919
}
4919-
throw new Error('Value [' + value + '] does not match the xs:date pattern.');
4920+
throw new Error('Value [' + text + '] does not match the xs:date pattern.');
49204921
},
49214922
parseTime : function(text, context, input, scope) {
49224923
Jsonix.Util.Ensure.ensureString(text);
@@ -4932,7 +4933,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49324933
};
49334934
return new Jsonix.XML.Calendar(data);
49344935
}
4935-
throw new Error('Value [' + value + '] does not match the xs:time pattern.');
4936+
throw new Error('Value [' + text + '] does not match the xs:time pattern.');
49364937
},
49374938
parseTimezoneString : function(text) {
49384939
// (('+' | '-') hh ':' mm) | 'Z'
@@ -4955,7 +4956,7 @@ Jsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
49554956
var minute = parseInt(results[5], 10);
49564957
return sign * (hour * 60 + minute);
49574958
}
4958-
throw new Error('Value [' + value + '] does not match the timezone pattern.');
4959+
throw new Error('Value [' + text + '] does not match the timezone pattern.');
49594960
}
49604961
},
49614962
print : function(value, context, output, scope) {

nodejs/tests/ar/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/tests/basic/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/tests/browserify/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/tests/po/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/tests/wps/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)