2011-11-14 6 views
1

私の.jsファイルで何が問題なのかを知る方法はわかりませんが、 "defaultDebugEnaled = true"にするとうまくいきますが、falseにするとこのエラーを取得Combresとyuiで縮小できない

私はそれが私により具体的なエラーを与えるために何かを切り替えることができない、私はそれを縮小しようとすると失敗することを知っている。

これは、ある特定のファイルを含めると発生しますが、これは動作しているだけで、そのファイルを投稿することはできません。

Server Error in '/' Application. 

[ERROR] missing formal parameter 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: [ERROR] missing formal parameter 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[InvalidOperationException: [ERROR] missing formal parameter] 
    Yahoo.Yui.Compressor.CustomErrorReporter.Error(String message, String sourceName, Int32 line, String lineSource, Int32 lineOffset) +61 
    EcmaScript.NET.Parser.AddError(String messageId) +94 
    EcmaScript.NET.Parser.ReportError(String messageId) +9 
    EcmaScript.NET.Parser.function(Int32 functionType) +700 
    EcmaScript.NET.Parser.parseFunctionBody() +138 
    EcmaScript.NET.Parser.function(Int32 functionType) +932 
    EcmaScript.NET.Parser.primaryExpr() +334 
    EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213 
    EcmaScript.NET.Parser.unaryExpr() +605 
    EcmaScript.NET.Parser.mulExpr() +16 
    EcmaScript.NET.Parser.addExpr() +16 
    EcmaScript.NET.Parser.shiftExpr() +16 
    EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21 
    EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25 
    EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28 
    EcmaScript.NET.Parser.expr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.primaryExpr() +1233 
    EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213 
    EcmaScript.NET.Parser.unaryExpr() +605 
    EcmaScript.NET.Parser.mulExpr() +16 
    EcmaScript.NET.Parser.addExpr() +16 
    EcmaScript.NET.Parser.shiftExpr() +16 
    EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21 
    EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25 
    EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26 
    EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28 
    EcmaScript.NET.Parser.expr(Boolean inForInit) +23 
    EcmaScript.NET.Parser.statementHelper(Node statementLabel) +9649 
    EcmaScript.NET.Parser.statement() +71 
    EcmaScript.NET.Parser.Parse() +333 
    EcmaScript.NET.Parser.Parse(StreamReader sourceReader, String sourceURI, Int32 lineno) +64 
    Yahoo.Yui.Compressor.JavaScriptCompressor.Parse(StreamReader stream, ErrorReporter reporter) +71 
    Yahoo.Yui.Compressor.JavaScriptCompressor..ctor(String javaScript, Boolean isVerboseLogging, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored, ErrorReporter errorReporter) +391 
    Yahoo.Yui.Compressor.JavaScriptCompressor.Compress(String javaScript, Boolean isVerboseLogging, Boolean isObfuscateJavascript, Boolean preserveAllSemicolons, Boolean disableOptimizations, Int32 lineBreakPosition, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored) +73 
    Combres.Minifiers.YuiJSMinifier.Minify(Settings settings, ResourceSet resourceSet, String combinedContent) +355 
    Combres.RequestProcessor.MinifyContent(MinifierInfo minifierInfo, IEnumerable`1 resources, String combinedContent) +340 
    Combres.DefaultProcessingWorkflow.ProcessMergeGroup(ICollection`1 minifiedContents, IEnumerable`1 mergeGroup, MinifierInfo currentMinifier) +63 
    Combres.DefaultProcessingWorkflow.Execute() +344 
    Combres.RequestProcessor.Execute() +160 
    Combres.CombresHandler.ProcessRequest(HttpContext context) +94 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 

答えて

5

"仮パラメータがありません"は、関数定義にパラメータがないことを意味します。例えば

/** 
* @param x ... 
* @param y ... 
*/ 
function f(x) { // Only one formal parameter. 
    ... 
} 

f(1, 2); // Called with 2 actual parameters. 

機能fは仮パラメータyが欠落しています。

EDIT:

https://github.com/wycats/handlebars.js/issues/93は同様の問題を議論し、問題があることを示唆予約語を仮パラメータとして使用される予約語を発行このエラーをとしてYUIコンプレッサ扱い特定JS識別子(誤って)

$ java -jar lib/closurecompiler.jar --js js/handlebars.1.0.0.beta.3.js 
js/handlebars.1.0.0.beta.3.js:667: ERROR - Parse error. missing formal parameter 
Handlebars.AST.BooleanNode = function(boolean) { 

私のフォークで動作しているようです。主な変更はs/boolean/bool/gで予約語を削除することでした。 一貫性を保つために入力.jsファイルを埋め込みました。

+1

私は400行あるより具体的なエラー(どの行)を取得する方法はありません – Mech0z

+0

@MechOz、私の編集を参照してください。 –

1

私は昨日、この同じ問題を抱えていた(「長い」であることが判明したパラメータを使用 - ちょうど経度に改名I) - と私のための最善のアプローチは、これらの2つのツールに手動でJSを養うことでした。http://www.javascriptlint.com/online_lint.phpオンラインYUIコンプレッサーhttp://refresh-sf.com/yui/

2つの間にエラーを見つけて圧縮することが容易でした。このようなparametresを使用した場合

1

も、このエラーが表示されることがあります。

function functionName(markers, boolean) 

この場合booleanは、エラーが発生します。

関連する問題