diff --git a/javascript/i18n/phonenumbers/demo-compiled.js b/javascript/i18n/phonenumbers/demo-compiled.js index 68be9d056..1ec1a2408 100644 --- a/javascript/i18n/phonenumbers/demo-compiled.js +++ b/javascript/i18n/phonenumbers/demo-compiled.js @@ -431,9 +431,9 @@ B:"2",C:"2",D:"3",E:"3",F:"3",G:"4",H:"4",I:"4",J:"5",K:"5",L:"5",M:"6",N:"6",O: function O(a,b){for(var c=new C,d,e=a.length,f=0;f=e)a=c;else if(d=d.substring(0,e),d=O(d,L),d.length)if(g=g.clone(),Ga(g,4),d=[g],g=y(b,1),c=Q(b),g in J){a=S(a,g,T(g));if(e=tb(d,c))d=e.clone(),e=y(e,4),0=e)a=c;else if(d=d.substring(0,e),d=O(d,L),d.length)if(g=g.clone(),Ga(g,4),d=[g],g=y(b,1),c=Q(b),g in J){a=S(a,g,T(g));if(e=tb(d,c))d=e.clone(),e=y(e,4),0 0) { return Array(number.getNumberOfLeadingZerosOrDefault() + 1).join('0') + diff --git a/javascript/i18n/phonenumbers/phonenumberutil_test.js b/javascript/i18n/phonenumbers/phonenumberutil_test.js index 00d2903c0..079cd9e50 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil_test.js +++ b/javascript/i18n/phonenumbers/phonenumberutil_test.js @@ -492,6 +492,11 @@ function testGetNationalSignificantNumber() { assertEquals('12345678', phoneUtil.getNationalSignificantNumber(INTERNATIONAL_TOLL_FREE)); + + // An empty number. + /** @type {i18n.phonenumbers.PhoneNumber} */ + var emptyNumber = new i18n.phonenumbers.PhoneNumber(); + assertEquals('', phoneUtil.getNationalSignificantNumber(emptyNumber)); } function testGetNationalSignificantNumber_ManyLeadingZeros() { diff --git a/pending_code_changes.txt b/pending_code_changes.txt index ff9abe09e..08e1a6572 100644 --- a/pending_code_changes.txt +++ b/pending_code_changes.txt @@ -7,3 +7,5 @@ Code changes: digits inadvertently. Now this is checked at the end of the method anyway. However slight formatting differences with this method on invalid numbers starting with 0s may be noticed in some countries. + - Bug fix for Javascript: getNationalSignificantNumber used to print the string + "null" for empty phone number objects, now it returns an empty string.