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
3a9c84bc
Commit
3a9c84bc
authored
Nov 18, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Importer: Moves the setter inside condition.
parent
00057b70
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
binding.cpp
src/binding.cpp
+12
-10
No files found.
src/binding.cpp
View file @
3a9c84bc
...
...
@@ -60,6 +60,16 @@ struct Sass_Import** sass_importer(const char* file, void* cookie)
}
void
ExtractOptions
(
Local
<
Object
>
options
,
void
*
cptr
,
sass_context_wrapper
*
ctx_w
,
bool
isFile
)
{
struct
Sass_Context
*
ctx
;
if
(
isFile
)
{
ctx
=
sass_file_context_get_context
((
struct
Sass_File_Context
*
)
cptr
);
}
else
{
ctx
=
sass_data_context_get_context
((
struct
Sass_Data_Context
*
)
cptr
);
}
struct
Sass_Options
*
sass_options
=
sass_context_get_options
(
ctx
);
if
(
ctx_w
)
{
NanAssignPersistent
(
ctx_w
->
stats
,
options
->
Get
(
NanNew
(
"stats"
))
->
ToObject
());
...
...
@@ -77,18 +87,11 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
ctx_w
->
callback
=
new
NanCallback
(
callback
);
ctx_w
->
error_callback
=
new
NanCallback
(
error_callback
);
ctx_w
->
importer_callback
=
new
NanCallback
(
importer_callback
);
}
struct
Sass_Context
*
ctx
;
if
(
isFile
)
{
ctx
=
sass_file_context_get_context
((
struct
Sass_File_Context
*
)
cptr
);
}
else
{
ctx
=
sass_data_context_get_context
((
struct
Sass_Data_Context
*
)
cptr
);
if
(
!
importer_callback
->
IsUndefined
())
sass_option_set_importer
(
sass_options
,
sass_make_importer
(
sass_importer
,
ctx_w
->
importer_callback
));
}
struct
Sass_Options
*
sass_options
=
sass_context_get_options
(
ctx
);
sass_option_set_output_path
(
sass_options
,
CreateString
(
options
->
Get
(
NanNew
(
"outFile"
))));
sass_option_set_image_path
(
sass_options
,
CreateString
(
options
->
Get
(
NanNew
(
"imagePath"
))));
sass_option_set_output_style
(
sass_options
,
(
Sass_Output_Style
)
options
->
Get
(
NanNew
(
"style"
))
->
Int32Value
());
...
...
@@ -100,7 +103,6 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
sass_option_set_source_map_file
(
sass_options
,
CreateString
(
options
->
Get
(
NanNew
(
"sourceMap"
))));
sass_option_set_include_path
(
sass_options
,
CreateString
(
options
->
Get
(
NanNew
(
"paths"
))));
sass_option_set_precision
(
sass_options
,
options
->
Get
(
NanNew
(
"precision"
))
->
Int32Value
());
sass_option_set_importer
(
sass_options
,
sass_make_importer
(
sass_importer
,
ctx_w
->
importer_callback
));
}
void
FillStatsObj
(
Handle
<
Object
>
stats
,
Sass_Context
*
ctx
)
{
...
...
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