Fix a confusing error message for '(arguments) ->'

This commit is contained in:
Jakub Wieczorek
2012-02-12 15:37:15 +01:00
parent cb0003d894
commit eb8e20c3ef
2 changed files with 2 additions and 2 deletions

View File

@@ -1684,7 +1684,7 @@
this.name = name;
this.value = value;
this.splat = splat;
if (name = (_ref3 = this.name.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
if (_ref3 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0) {
throw SyntaxError("parameter name \"" + name + "\" is not allowed");
}
}

View File

@@ -1230,7 +1230,7 @@ exports.Code = class Code extends Base
# as well as be a splat, gathering up a group of parameters into an array.
exports.Param = class Param extends Base
constructor: (@name, @value, @splat) ->
if name = @name.unwrapAll().value in STRICT_PROSCRIBED
if (name = @name.unwrapAll().value) in STRICT_PROSCRIBED
throw SyntaxError "parameter name \"#{name}\" is not allowed"
children: ['name', 'value']