我不知道如何更多地了解我的.js文件有什么问题,但是如果我将"defaultDebugEnaled = true“设置为”true“,那么它就可以正常工作,但是如果将它设置为false,就会得到这个错误
我似乎不能切换任何东西来使它给我一个更具体的错误,我只知道它在试图最小化它时失败。
此外,这只发生在我包括一个特定的文件,但这是工作,所以不能只是发布该文件。
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
发布于 2011-11-14 21:58:39
“缺少形参”表示函数定义缺少参数。例如
/**
* @param x ...
* @param y ...
*/
function f(x) { // Only one formal parameter.
...
}
f(1, 2); // Called with 2 actual parameters.
函数f
缺少形参y
。
编辑:
https://github.com/wycats/handlebars.js/issues/93讨论了一个类似的问题,并建议问题是YUI压缩器将某些JS标识符(错误地)视为保留字,并在保留字用作正式参数时发出此错误
-jar -js-jar/handlebars.1.0.0.beta.3.js js/handlebars.1.0.0.beta.3.js /handlebars.1.0.0.beta.3.js:667:
-解析错误。缺少形式参数Handlebars.AST.BooleanNode =function(布尔值){
我有一个版本似乎在我的分支中工作。主要的更改是删除了带有s/boolean/bool/g的保留字,还对输入的.js文件进行了内联以保持一致性。
发布于 2013-09-04 15:54:46
使用如下参数时也可能出现此错误:
function functionName( markers, boolean )
在这种情况下,boolean
将导致错误。
发布于 2013-01-25 05:47:39
我昨天遇到了同样的问题(结果是'long‘使用了一个参数-我只是重命名为经度)-对我来说最好的方法是手动将JS提供给这两个工具:http://www.javascriptlint.com/online_lint.php和一个在线YUI压缩器http://refresh-sf.com/yui/
在这两者之间,很容易找到错误并验证它是否可以压缩。
https://stackoverflow.com/questions/8122253
复制相似问题