diff --git a/javascript/README.md b/javascript/README.md
index 933d33aac..973714f7f 100644
--- a/javascript/README.md
+++ b/javascript/README.md
@@ -69,9 +69,7 @@ project:
4. Run the Closure Compiler to get your changes syntax and type checked. This will also generate `demo-compiled.js` used by `demo-compiler.html`
- (TODO: Use target "compile" rather than "compile-demo" once visibility issues for getExtractedNationalPrefix_ have been resolved):
-
- `ant -f javascript/build.xml compile-demo`
+ `ant -f javascript/build.xml compile`
5. Run the Closure Linter to lint the JavaScript files:
diff --git a/javascript/build.xml b/javascript/build.xml
index 30d4ca33d..f65b1a9c8 100644
--- a/javascript/build.xml
+++ b/javascript/build.xml
@@ -43,12 +43,14 @@
+
+
diff --git a/javascript/i18n/phonenumbers/asyoutypeformatter.js b/javascript/i18n/phonenumbers/asyoutypeformatter.js
index 8b8f10d1f..db6bdcf94 100644
--- a/javascript/i18n/phonenumbers/asyoutypeformatter.js
+++ b/javascript/i18n/phonenumbers/asyoutypeformatter.js
@@ -35,12 +35,7 @@ goog.provide('i18n.phonenumbers.AsYouTypeFormatter');
goog.require('goog.string.StringBuffer');
goog.require('i18n.phonenumbers.NumberFormat');
goog.require('i18n.phonenumbers.PhoneMetadata');
-goog.require('i18n.phonenumbers.PhoneMetadataCollection');
-goog.require('i18n.phonenumbers.PhoneNumber');
-goog.require('i18n.phonenumbers.PhoneNumber.CountryCodeSource');
-goog.require('i18n.phonenumbers.PhoneNumberDesc');
goog.require('i18n.phonenumbers.PhoneNumberUtil');
-goog.require('i18n.phonenumbers.metadata');
diff --git a/javascript/i18n/phonenumbers/demo-compiled.js b/javascript/i18n/phonenumbers/demo-compiled.js
index b15220aa2..b9efd33f0 100644
--- a/javascript/i18n/phonenumbers/demo-compiled.js
+++ b/javascript/i18n/phonenumbers/demo-compiled.js
@@ -1,15 +1,16 @@
-(function(){for(var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},k="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,l=["String","prototype","repeat"],ba=0;baa||1342177279>>=1)b+=b;return c};fa!=ea&&null!=fa&&aa(k,da,{configurable:!0,writable:!0,value:fa});
-function ga(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
-else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function n(a){return"string"==typeof a}function p(a,b){function c(){}c.prototype=b.prototype;a.ca=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.ma=function(a,c,f){for(var d=Array(arguments.length-2),e=2;ec?Math.max(0,a.length+c):c;if(n(a))return n(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa||1342177279>>=1)b+=b;return d}});ca("Math.sign",function(a){return a?a:function(a){a=Number(a);return!a||isNaN(a)?a:0c?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa.length?!1:N(eb,a)}function mb(a){return N(cb,a)?O(a,Wa):O(a,L)}function nb(a){var b=mb(a.toString());C(a);a.a(b)}function ob(a){return!!a&&(1!=y(a,9)||-1!=w(a,9)[0])}
-function O(a,b){for(var c=new B,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(),La(g,4),d=[g],g=x(b,1),c=Q(b),g in J){a=T(a,g,U(g));if(e=xb(d,c))d=e.clone(),e=x(e,4),0b?2:f[f.length-1]=f&&f<=e;++f)if(d=parseInt(c.substring(0,f),10),d in J)return b.a(c.substring(f)),d;return 0}
-function Ib(a,b,c,d,e,f){if(!b.length)return 0;b=new B(b);var g;c&&(g=u(c,11));null==g&&(g="NonMatch");var h=b.toString();if(h.length)if(M.test(h))h=h.replace(M,""),C(b),b.a(mb(h)),g=1;else{h=new RegExp(g);nb(b);g=b.toString();if(g.search(h))g=!1;else{var h=g.match(h)[0].length,m=g.substring(h).match(Za);m&&null!=m[1]&&0=b.b.length)throw Error("Phone number too short after IDD");if(a=Hb(b,
-d))return v(f,1,a),a;throw Error("Invalid country calling code");}if(c&&(g=x(c,10),h=""+g,m=b.toString(),!m.lastIndexOf(h,0)&&(h=new B(m.substring(h.length)),m=u(c,1),m=new RegExp(x(m,2)),Jb(h,c,null),h=h.toString(),!N(m,b.toString())&&N(m,h)||3==Fb(a,b.toString(),c,-1))))return d.a(h),e&&v(f,6,10),v(f,1,g),g;v(f,1,0);return 0}
-function Jb(a,b,c){var d=a.toString(),e=d.length,f=u(b,15);if(e&&null!=f&&f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){var f=new RegExp(x(u(b,1),2)),h=N(f,d),m=e.length-1;b=u(b,16);if(null!=b&&b.length&&null!=e[m]&&e[m].length){if(d=d.replace(g,b),!h||N(f,d))c&&0g.b.length)throw Error("The string supplied is too short to be a phone number");b&&(c=new B,e=new B(g.toString()),Jb(e,b,c),2!=Fb(a,e.toString(),b,-1)&&(g=e,d&&0d)throw Error("The string supplied is too short to be a phone number");if(17a.length?!1:N($a,a)}function hb(a){return N(Ya,a)?O(a,Ra):O(a,L)}function ib(a){var b=hb(a.toString());C(a);a.a(b)}function kb(a){return!!a&&(1!=y(a,9)||-1!=w(a,9)[0])}
+function O(a,b){for(var c=new B,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=x(b,1),c=R(b),g in J){a=T(a,g,U(g));if(e=sb(d,c))d=e.clone(),e=x(e,4),0b?2:f[f.length-1]=f&&f<=e;++f)if(d=parseInt(c.substring(0,f),10),d in J)return b.a(c.substring(f)),d;return 0}
+function Db(a,b,c,d,e,f){if(!b.length)return 0;b=new B(b);var g;c&&(g=u(c,11));null==g&&(g="NonMatch");var h=b.toString();if(h.length)if(M.test(h))h=h.replace(M,""),C(b),b.a(hb(h)),g=1;else{h=new RegExp(g);ib(b);g=b.toString();if(g.search(h))g=!1;else{var h=g.match(h)[0].length,m=g.substring(h).match(Ua);m&&null!=m[1]&&0=b.b.length)throw Error("Phone number too short after IDD");if(a=Cb(b,
+d))return v(f,1,a),a;throw Error("Invalid country calling code");}if(c&&(g=x(c,10),h=""+g,m=b.toString(),!m.lastIndexOf(h,0)&&(h=new B(m.substring(h.length)),m=u(c,1),m=new RegExp(x(m,2)),Eb(h,c,null),h=h.toString(),!N(m,b.toString())&&N(m,h)||3==Ab(a,b.toString(),c,-1))))return d.a(h),e&&v(f,6,10),v(f,1,g),g;v(f,1,0);return 0}
+function Eb(a,b,c){var d=a.toString(),e=d.length,f=u(b,15);if(e&&null!=f&&f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){var f=new RegExp(x(u(b,1),2)),h=N(f,d),m=e.length-1;b=u(b,16);if(null!=b&&b.length&&null!=e[m]&&e[m].length){if(d=d.replace(g,b),!h||N(f,d))c&&0g.b.length)throw Error("The string supplied is too short to be a phone number");b&&(c=new B,e=new B(g.toString()),Eb(e,b,c),2!=Ab(a,e.toString(),b,-1)&&(g=e,d&&0d)throw Error("The string supplied is too short to be a phone number");if(17