title: Octal literals are not available when targeting ECMAScript 5 and higher
body: <p>I am building a norwegaian SSN validator in angularjs and getting the error as 'Octal literals are not  available when targeting ECMAScript 5 and higher.' but everything works fine in es3 mode ,please help me with the issue </p>
  
  <pre><code>module ec.directives {
      export function norwegianSsnValidator(){
        return {
          restrict: 'A',
          require: 'ngModel',
          link: function(scope, element, attrs, ctrl){
              ctrl.$validators.invalidSSN = function(ssn:string){
                  if(typeof ssn !== "string"){
                      return false;
                  }
                  var pno = ssn, day, month, year,
                      ind, c1, c2, yearno;
                  // Check length
                  if( pno.length != 11 )
                      return false;
  
                  // Split
                  day = pno.substr(0,2);
                  month = pno.substr(2,2);
                  year = pno.substr(4,2);
                  ind = pno.substr(6,3);
                  c1 = pno.substr(9,1);
                  c2 = pno.substr(10,1);
                  yearno = parseInt(year);
  
                  if( ind &gt; 0 &amp;&amp; ind &lt; 500 ) {
                      yearno += 1900;
                  } else if( ind &gt; 499 &amp;&amp; ind &lt; 750 &amp;&amp; year &gt; 55 &amp;&amp; year &lt; 100) {
                      yearno += 1800;
                  } else if( ind &gt; 499 &amp;&amp; ind &lt; 999 &amp;&amp; year &gt;= 00 &amp;&amp; year &lt; 40) {
                      yearno += 2000;
                  } else if( ind &gt; 899 &amp;&amp; ind &lt; 999 &amp;&amp; year &gt; 39 &amp;&amp; year &lt; 100) {
                      yearno += 1900;
                  } else {
                      return false;
                  }
                  var d1, d2,m1,m2,a1,a2,i1,i2,i3, c1calc, c2calc;
                  d1 = parseInt(day.substr(0,1));
                  d2 = parseInt(day.substr(1,1));
                  m1 = parseInt(month.substr(0,1));
                  m2 = parseInt(month.substr(1,1));
                  a1 = parseInt(year.substr(0,1));
                  a2 = parseInt(year.substr(1,1));
                  i1 = parseInt(ind.substr(0,1));
                  i2 = parseInt(ind.substr(1,1));
                  i3 = parseInt(ind.substr(2,1));
  
                  // Calculate control check c1
                  c1calc = 11 - (((3*d1) + (7*d2) + (6*m1) + m2 + (8*a1) + (9*a2) + (4*i1) + (5*i2) + (2*i3)) % 11);
                  if( c1calc == 11 )
                      c1calc = 0;
                  if( c1calc == 10 )
                      return false;
                  if( c1 != c1calc )
                      return false;
  
                  // Calculate control check c2
                  c2calc = 11 - (((5*d1) + (4*d2) + (3*m1) + (2*m2) + (7*a1) + (6*a2) + (5*i1) + (4*i2) + (3*i3) + (2*c1calc)) % 11);
                  if( c2calc == 11 )
                      c2calc = 0;
                  if( c2calc == 10 )
                      return false;
                  if( c2 != c2calc )
                      return false;
  
                  return true;
              };
          }
      }
    }
  }
  </code></pre>