sass 3.2.0.alpha.95 → 3.2.0.alpha.96
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/lib/sass/script/funcall.rb +4 -4
- data/test/sass/engine_test.rb +2 -0
- metadata +4 -4
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
71e121eea2e0cd0b5752f4a7ffdce70b16fcbf58
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.0.alpha.
|
1
|
+
3.2.0.alpha.96
|
data/lib/sass/script/funcall.rb
CHANGED
@@ -145,10 +145,10 @@ module Sass
|
|
145
145
|
|
146
146
|
def perform_sass_fn(function, args, keywords)
|
147
147
|
# TODO: merge with mixin arg evaluation?
|
148
|
-
keywords.
|
149
|
-
|
150
|
-
|
151
|
-
raise Sass::SyntaxError.new("Function #{@name} doesn't have an argument named $#{name}")
|
148
|
+
if keywords.any?
|
149
|
+
unknown_args = keywords.keys - function.args.map {|var| var.first.underscored_name }
|
150
|
+
if unknown_args.any?
|
151
|
+
raise Sass::SyntaxError.new("Function #{@name} doesn't have #{unknown_args.length > 1 ? 'the following arguments:' : 'an argument named'} #{unknown_args.map{|name| "$#{name}"}.join ', '}")
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
data/test/sass/engine_test.rb
CHANGED
@@ -106,6 +106,8 @@ MSG
|
|
106
106
|
"foo\n @function bar()\n @return 1" => ['Functions may only be defined at the root of a document.', 2],
|
107
107
|
"@function foo($a)\n @return 1\na\n b: foo()" => 'Function foo is missing parameter $a.',
|
108
108
|
"@function foo()\n @return 1\na\n b: foo(2)" => 'Wrong number of arguments (1 for 0) for `foo\'',
|
109
|
+
"@function foo()\n @return 1\na\n b: foo($a: 1)" => "Function foo doesn't have an argument named $a",
|
110
|
+
"@function foo()\n @return 1\na\n b: foo($a: 1, $b: 2)" => "Function foo doesn't have the following arguments: $a, $b",
|
109
111
|
"@return 1" => '@return may only be used within a function.',
|
110
112
|
"@if true\n @return 1" => '@return may only be used within a function.',
|
111
113
|
"@mixin foo\n @return 1\n@include foo" => ['@return may only be used within a function.', 2],
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592303069
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.2.0.alpha.
|
11
|
+
- 96
|
12
|
+
version: 3.2.0.alpha.96
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2012-03-
|
22
|
+
date: 2012-03-22 00:00:00 -04:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|