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
86872644
Commit
86872644
authored
Sep 06, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding bounds checking for hsla.
parent
08ca7622
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
functions.cpp
functions.cpp
+11
-4
No files found.
functions.cpp
View file @
86872644
...
@@ -250,10 +250,17 @@ namespace Sass {
...
@@ -250,10 +250,17 @@ namespace Sass {
bindings
[
parameter_names
[
3
].
token
()].
is_numeric
()))
{
bindings
[
parameter_names
[
3
].
token
()].
is_numeric
()))
{
throw_eval_error
(
"arguments to hsla must be numeric"
,
bindings
[
parameter_names
[
0
].
token
()].
path
(),
bindings
[
parameter_names
[
0
].
token
()].
line
());
throw_eval_error
(
"arguments to hsla must be numeric"
,
bindings
[
parameter_names
[
0
].
token
()].
path
(),
bindings
[
parameter_names
[
0
].
token
()].
line
());
}
}
double
h
=
bindings
[
parameter_names
[
0
].
token
()].
numeric_value
();
Node
hn
(
bindings
[
parameter_names
[
0
].
token
()]);
double
s
=
bindings
[
parameter_names
[
1
].
token
()].
numeric_value
();
Node
sn
(
bindings
[
parameter_names
[
1
].
token
()]);
double
l
=
bindings
[
parameter_names
[
2
].
token
()].
numeric_value
();
Node
ln
(
bindings
[
parameter_names
[
2
].
token
()]);
double
a
=
bindings
[
parameter_names
[
3
].
token
()].
numeric_value
();
Node
an
(
bindings
[
parameter_names
[
3
].
token
()]);
double
h
=
hn
.
numeric_value
();
double
s
=
sn
.
numeric_value
();
double
l
=
ln
.
numeric_value
();
double
a
=
an
.
numeric_value
();
if
(
s
<
0
||
100
<
s
)
throw_eval_error
(
"saturation must be between 0% and 100% for 'hsla'"
,
sn
.
path
(),
sn
.
line
());
if
(
l
<
0
||
100
<
l
)
throw_eval_error
(
"lightness must be between 0% and 100% for 'hsla'"
,
ln
.
path
(),
ln
.
line
());
if
(
a
<
0
||
1
<
a
)
throw_eval_error
(
"alpha must be between 0 and 1 for 'hsla'"
,
an
.
path
(),
an
.
line
());
Node
color
(
hsla_impl
(
h
,
s
,
l
,
a
,
new_Node
));
Node
color
(
hsla_impl
(
h
,
s
,
l
,
a
,
new_Node
));
return
color
;
return
color
;
}
}
...
...
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