Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
22059711
Commit
22059711
authored
Apr 16, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking validity of keyword args.
parent
7743908a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletions
+23
-1
eval_apply.cpp
eval_apply.cpp
+11
-1
exceptional.scss
exceptional.scss
+11
-0
node_comparisons.cpp
node_comparisons.cpp
+1
-0
No files found.
eval_apply.cpp
View file @
22059711
...
...
@@ -311,7 +311,6 @@ namespace Sass {
double
operate
(
Node
::
Type
op
,
double
lhs
,
double
rhs
)
{
// TO DO: check for division by zero
switch
(
op
)
{
case
Node
:
:
add
:
return
lhs
+
rhs
;
break
;
...
...
@@ -332,6 +331,17 @@ namespace Sass {
if
(
args
[
i
].
type
==
Node
::
assignment
)
{
Node
arg
(
args
[
i
]);
Token
name
(
arg
[
0
].
content
.
token
);
// check that the keyword arg actually names a formal parameter
bool
valid_param
=
false
;
for
(
int
k
=
0
;
k
<
params
.
size
();
++
k
)
{
Node
param_k
=
params
[
k
];
if
(
param_k
.
type
==
Node
::
assignment
)
param_k
=
param_k
[
0
];
if
(
arg
[
0
]
==
param_k
)
{
valid_param
=
true
;
break
;
}
}
if
(
!
valid_param
)
eval_error
(
"mixin "
+
mixin
[
0
].
to_string
(
""
)
+
" has no parameter named "
+
name
.
to_string
(),
arg
.
line_number
,
arg
.
file_name
);
if
(
!
bindings
.
query
(
name
))
{
bindings
[
name
]
=
eval
(
arg
[
1
],
env
,
f_env
);
}
...
...
exceptional.scss
View file @
22059711
...
...
@@ -29,3 +29,13 @@ div[hux ~= "hello"] {
moo
:
rgba
(
0
,
0
,
0
,.
5
)
+
3
;
}
$y
:
hey
;
@mixin
foo
(
$x
)
{
foofoo
:
$x
$y
;
}
div
{
@include
foo
(
$x
:
ho
,
goo
,
hey
,
boo
);
}
\ No newline at end of file
node_comparisons.cpp
View file @
22059711
...
...
@@ -32,6 +32,7 @@ namespace Sass {
return
true
;
}
break
;
case
variable
:
case
identifier
:
case
uri
:
case
textual_percentage
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment