ECMAScript6語法檢查規範錯誤信息說明

項目中使用ECMAScript6的時候經查會使用語法檢查,下面是常見錯誤信息的彙總:javascript

  1 「Missing semicolon.」 : 「缺乏分號.」,
  2 「Use the function form of \」use strict\」.」 : 「使用標準化定義function.」,
  3 「Unexpected space after ‘-’.」 : 「在’-'後面不該出現空格.」,
  4 「Expected a JSON value.」 : 「請傳入一個json的值.」,
  5 「Mixed spaces and tabs.」: 「空格和TAB重複.」,
  6 「Unsafe character.」 : 「不安全的字符.」,
  7 「Line too long.」: 「本行中的字符超過設定的最大長度.」,
  8 「Trailing whitespace.」: 「本行末尾有過多無用空格.」,
  9 「Script URL.」 : 「腳本URL.」,
 10 「Unexpected {a} in ‘{b}’.」 : 「在 ‘{b}’ 中不應出現 {a}.」,
 11 「Unexpected ‘{a}’.」 : 「不應在此出現’{a}’.」,
 12 「Strings must use doublequote.」 : 「字符串須要用雙引號」,
 13 「Unnecessary escapement.」 : 「不須要轉義」,
 14 「Control character in string: {a}.」 : 「在字符串中出現了Control的字符」,
 15 「Avoid \\’.」 : 「避免 \\」,
 16 「Avoid \\v.」 : 「避免 \\v」,
 17 「Avoid \\x-.」 : 「避免 \\x-」,
 18 「Bad escapement.」 : 「錯誤的轉義字符」,
 19 「Bad number ‘{a}’.」 : 「錯誤的數字 ‘{a}’」,
 20 「Missing space after ‘{a}’.」 : 「在’{a}’以後缺乏空格」,
 21 「Don’t use extra leading zeros ‘{a}’.」 : 「不要再’{a}’的前面用多餘的0″,
 22 「Avoid 0x-. ‘{a}’.」 : 「避免使用 0x-. ‘{a}’.」,
 23 「A trailing decimal point can be confused with a dot ‘{a}’.」 : 「在’{a}’中使用點尾隨小數點」,
 24 「Unexpected comment.」 : 「不應在此處出現註釋」,
 25 「Unescaped ‘{a}’.」 : 「沒有轉義 ‘{a}’」,
 26 「Unexpected control character in regular expression.」 : 「在正則表達式中出現了control字符」,
 27 「Unexpected escaped character ‘{a}’ in regular expression.」 : 「在正則表達式中出現了沒有轉義的字符 ‘{a}’」,
 28 「Expected ‘{a}’ and instead saw ‘{b}’.」 : 「應該用 ‘{a}’代替’{b}’」,
 29 「Spaces are hard to count. Use {{a}}.」 : 「空格難以統計,請使用 {{a}}」,
 30 「Insecure ‘{a}’.」 : 「不安全的 ‘{a}’」,
 31 「Empty class.」 : 「空的class」,
 32 「Expected a number and instead saw ‘{a}’.」:「應該用數字代替’{a}’」,
 33 「‘{a}’ should not be greater than ‘{b}’.」:「‘{a}’不該該比’{b}’大」,
 34 「‘hasOwnProperty’ is a really bad name.」: 「‘hasOwnProperty’是關鍵字」,
 35 「‘{a}’ was used before it was defined.」:「‘{a}’未定義就已經使用了.」,
 36 「‘{a}’ is already defined.」:「‘{a}’被重複定義」,
 37 「A dot following a number can be confused with a decimal point.」:「數字後面的一個點會被誤認爲是十進制的小數點」,
 38 「Confusing minusses」 : 「容易混淆的負數表達-」,
 39 「Confusing plusses.」 : 「容易混淆的正數表達+」,
 40 「Unmatched ‘{a}’.」 : 「沒法匹配的’{a}’」,
 41 「Expected ‘{a}’ to match ‘{b}’ from line {c} and instead saw ‘{d}’.」:「在行{c}中須要用’{a}’和’{b}’匹配,用來代替’{d}’」,
 42 「Unexpected early end of program.」:「程序不可預期的提早終止」,
 43 「A leading decimal point can be confused with a dot: ‘.{a}’.」:「‘{a}’前的點容易混淆成小數點」,
 44 「Use the array literal notation [].」:「使用數組的符號 []「,
 45 「Expected an operator and instead saw ‘{a}’.」:「須要用一個符號來代替’{a}’」,
 46 「Unexpected space after ‘{a}’.」:「在’{a}’以後不能出現空格」,
 47 「Unexpected space before ‘{a}’.」:「在’{a}’以前不能出現空格」,
 48 「Bad line breaking before ‘{a}’.」:「在’{a}’以前錯誤的換行」,
 49 「Expected ‘{a}’ to have an indentation at {b} instead at {c}.」:「‘{a}’須要在{c}而不是{b}處縮進」,
 50 「Line breaking error ‘{a}’.」:「換行錯誤 ‘{a}’」,
 51 「Unexpected use of ‘{a}’.」:「此處不能用’{a}’」,
 52 「Bad operand.」:「錯誤的操做數」,
 53 「Use the isNaN function to compare with NaN.」:「使用isNaN來與NaN比較」,
 54 「Confusing use of ‘{a}’.」:「容易混淆的’{a}’的使用」,
 55 「Read only.」:「只讀的屬性」,
 56 「‘{a}’ is a function.」:「‘{a}’是一個函數」,
 57 ‘Bad assignment.’:「錯誤的賦值」,
 58 「Do not assign to the exception parameter.」:「不要給額外的參數賦值」,
 59 「Expected an identifier in an assignment and instead saw a function invocation.」:「在賦值的語句中須要有一個標識符,而不是一個方法的調用」,
 60 「Expected an identifier and instead saw ‘{a}’ (a reserved word).」:「須要有一個標識符,而不是’{a}’(保留字符)」,
 61 「Missing name in function declaration.」:「在方法聲明中缺乏名稱」,
 62 「Expected an identifier and instead saw ‘{a}’.」:「須要有一個標識符,而不是’{a}’」,
 63 「Inner functions should be listed at the top of the outer function.」:「內部函數的聲明應該放在此函數的頂部。」,
 64 「Unreachable ‘{a}’ after ‘{b}’.」:「在’{b}’以後沒法獲取’{a}’」,
 65 「Unnecessary semicolon.」:「沒必要要的分號」,
 66 「Label ‘{a}’ on {b} statement.」:「將’{a}’放在{b}的聲明中」,
 67 「Label ‘{a}’ looks like a javascript url.」:「‘{a}’看上去像一個js的連接」,
 68 「Expected an assignment or function call and instead saw an expression」:「須要一個賦值或者一個函數調用,而不是一個表達式.」,
 69 「Do not use ‘new’ for side effects.」:「不要用’new’語句.」,
 70 「Unnecessary \」use strict\」.」:「沒必要要的\」use strict\」.」,
 71 「Missing \」use strict\」 statement.」:「缺乏\」use strict\」的聲明」,
 72 「Empty block.」:「空的模塊」,
 73 「Unexpected /*member ‘{a}’.」:「不該出現 /*元素 ‘{a}’.」,
 74 「‘{a}’ is a statement label.」:「‘{a}’是一個聲明」,
 75 「‘{a}’ used out of scope.」:「‘{a}’使用超出範圍」,
 76 「‘{a}’ is not allowed.」:「不容許使用’{a}’」,
 77 「‘{a}’ is not defined.」:「‘{a}’沒有被定義」,
 78 「Use ‘{a}’ to compare with ‘{b}’.」:「使用’{a}’與’{b}’相比」,
 79 「Variables should not be deleted.」:「變量須要被刪除」,
 80 「Use the object literal notation {}.」:「使用對象的文字符號 {}」,
 81 「Do not use {a} as a constructor.」:「不要使用{a}做爲一個構造對象」,
 82 「The Function constructor is eval.」:「The Function constructor is eval.」,
 83 「A constructor name should start with an uppercase letter.」:「一個構造對象的名稱必須用大寫字母開頭.」,
 84 「Bad constructor.」:「錯誤的構造對象」,
 85 「Weird construction. Delete ‘new’.」:「構造對象有誤,請刪除’new’」,
 86 「Missing ‘()’ invoking a constructor.」:「缺乏括號()」,
 87 「Avoid arguments.{a}.」:「避免參數.{a}.」,
 88 「document.write can be a form of eval.」:「document.write是eval的一種形式」,
 89 ‘eval is evil.’:「儘可能不要使用eval」,
 90 「Math is not a function.」:「Math不是一個函數」,
 91 「Missing ‘new’ prefix when invoking a constructor.」:「此處缺乏了’new’」,
 92 「Missing radix parameter.」:「缺乏參數」,
 93 「Implied eval is evil. Pass a function instead of a string.」:「傳遞一個函數,而不是一個字符串」,
 94 「Bad invocation.」:「錯誤的調用」,
 95 「['{a}'] is better written in dot notation.」:「['{a}']最好用點.的方式」,
 96 「Extra comma.」:「多餘的逗號」,
 97 「Don’t make functions within a loop.」:「不要用循環的方式建立函數」,
 98 「Unexpected parameter ‘{a}’ in get {b} function.」:「在{b}方法中不應用到參數’{a}’」,
 99 「Duplicate member ‘{a}’.」:「重複的’{a}’」,
100 「Expected to see a statement and instead saw a block.」:「此處應該是語句聲明.」,
101 「Too many var statements.」:「過多var的聲明」,
102 「Redefinition of ‘{a}’.」:「‘{a}’被重複定義」,
103 「It is not necessary to initialize ‘{a}’ to ‘undefined’.」:「無需將’{a}’初始化爲’undefined’」,
104 「Expected a conditional expression and instead saw an assignment.」:「此處須要一個表達式,而不是賦值語句」,
105 「Expected a ‘break’ statement before ‘case’.」:「在’case’以前須要有’break’.」,
106 「Expected a ‘break’ statement before ‘default’.」:「在’default’以前須要有’break’.」,
107 「This ‘switch’ should be an ‘if’.」:「此處’switch’應該是’if’.」,
108 「All ‘debugger’ statements should be removed.」:「請刪除’debugger’的語句」,
109 「‘{a}’ is not a statement label.」:「‘{a}’不是一個聲明標籤.」,
110 「Expected an assignment or function call and instead saw an expression.」:「須要一個語句或者一個函數調用,而不是一個表達式」,
111 「Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.」:「函數的聲明不能放在相似if的塊中,須要放在外部函數的頂部.」

 

以上內容節選自攜程設計委員會java

相關文章
相關標籤/搜索