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
bf9f6ec2
Commit
bf9f6ec2
authored
Aug 19, 2015
by
Marcin Cieslak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change obj->XxxValue() to Nan::To<xxx>() in binding.cpp
parent
4ed4739d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
9 deletions
+37
-9
binding.cpp
src/binding.cpp
+17
-9
lowlevel.js
test/lowlevel.js
+20
-0
No files found.
src/binding.cpp
View file @
bf9f6ec2
...
@@ -82,13 +82,21 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
...
@@ -82,13 +82,21 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
sass_option_set_input_path
(
sass_options
,
ctx_w
->
file
);
sass_option_set_input_path
(
sass_options
,
ctx_w
->
file
);
}
}
int
indent_len
=
Nan
::
Get
(
options
,
Nan
::
New
(
"indentWidth"
).
ToLocalChecked
()).
ToLocalChecked
()
->
Int32Value
();
int
indent_len
=
Nan
::
To
<
int32_t
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"indentWidth"
).
ToLocalChecked
()
).
ToLocalChecked
()).
FromJust
();
ctx_w
->
indent
=
(
char
*
)
malloc
(
indent_len
+
1
);
ctx_w
->
indent
=
(
char
*
)
malloc
(
indent_len
+
1
);
strcpy
(
ctx_w
->
indent
,
std
::
string
(
strcpy
(
ctx_w
->
indent
,
std
::
string
(
indent_len
,
indent_len
,
Nan
::
Get
(
options
,
Nan
::
New
(
"indentType"
).
ToLocalChecked
()).
ToLocalChecked
()
->
Int32Value
()
==
1
?
'\t'
:
' '
Nan
::
To
<
int32_t
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"indentType"
).
ToLocalChecked
()
).
ToLocalChecked
()).
FromJust
()
==
1
?
'\t'
:
' '
).
c_str
());
).
c_str
());
ctx_w
->
linefeed
=
create_string
(
Nan
::
Get
(
options
,
Nan
::
New
(
"linefeed"
).
ToLocalChecked
()));
ctx_w
->
linefeed
=
create_string
(
Nan
::
Get
(
options
,
Nan
::
New
(
"linefeed"
).
ToLocalChecked
()));
...
@@ -98,16 +106,16 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
...
@@ -98,16 +106,16 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
ctx_w
->
source_map_root
=
create_string
(
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapRoot"
).
ToLocalChecked
()));
ctx_w
->
source_map_root
=
create_string
(
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapRoot"
).
ToLocalChecked
()));
sass_option_set_output_path
(
sass_options
,
ctx_w
->
out_file
);
sass_option_set_output_path
(
sass_options
,
ctx_w
->
out_file
);
sass_option_set_output_style
(
sass_options
,
(
Sass_Output_Style
)
Nan
::
Get
(
options
,
Nan
::
New
(
"style"
).
ToLocalChecked
()).
ToLocalChecked
()
->
Int32Value
());
sass_option_set_output_style
(
sass_options
,
(
Sass_Output_Style
)
Nan
::
To
<
int32_t
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"style"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_is_indented_syntax_src
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"indentedSyntax"
).
ToLocalChecked
()).
ToLocalChecked
()
->
BooleanValue
());
sass_option_set_is_indented_syntax_src
(
sass_options
,
Nan
::
To
<
bool
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"indentedSyntax"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_source_comments
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceComments"
).
ToLocalChecked
()).
ToLocalChecked
()
->
BooleanValue
());
sass_option_set_source_comments
(
sass_options
,
Nan
::
To
<
bool
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceComments"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_omit_source_map_url
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"omitSourceMapUrl"
).
ToLocalChecked
()).
ToLocalChecked
()
->
BooleanValue
());
sass_option_set_omit_source_map_url
(
sass_options
,
Nan
::
To
<
bool
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"omitSourceMapUrl"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_source_map_embed
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapEmbed"
).
ToLocalChecked
()).
ToLocalChecked
()
->
BooleanValue
());
sass_option_set_source_map_embed
(
sass_options
,
Nan
::
To
<
bool
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapEmbed"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_source_map_contents
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapContents"
).
ToLocalChecked
()).
ToLocalChecked
()
->
BooleanValue
());
sass_option_set_source_map_contents
(
sass_options
,
Nan
::
To
<
bool
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"sourceMapContents"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_source_map_file
(
sass_options
,
ctx_w
->
source_map
);
sass_option_set_source_map_file
(
sass_options
,
ctx_w
->
source_map
);
sass_option_set_source_map_root
(
sass_options
,
ctx_w
->
source_map_root
);
sass_option_set_source_map_root
(
sass_options
,
ctx_w
->
source_map_root
);
sass_option_set_include_path
(
sass_options
,
ctx_w
->
include_path
);
sass_option_set_include_path
(
sass_options
,
ctx_w
->
include_path
);
sass_option_set_precision
(
sass_options
,
Nan
::
Get
(
options
,
Nan
::
New
(
"precision"
).
ToLocalChecked
()).
ToLocalChecked
()
->
Int32Value
());
sass_option_set_precision
(
sass_options
,
Nan
::
To
<
int32_t
>
(
Nan
::
Get
(
options
,
Nan
::
New
(
"precision"
).
ToLocalChecked
()).
ToLocalChecked
()).
FromJust
());
sass_option_set_indent
(
sass_options
,
ctx_w
->
indent
);
sass_option_set_indent
(
sass_options
,
ctx_w
->
indent
);
sass_option_set_linefeed
(
sass_options
,
ctx_w
->
linefeed
);
sass_option_set_linefeed
(
sass_options
,
ctx_w
->
linefeed
);
...
...
test/lowlevel.js
View file @
bf9f6ec2
...
@@ -94,4 +94,24 @@ describe('lowlevel', function() {
...
@@ -94,4 +94,24 @@ describe('lowlevel', function() {
},
/"result.stats" element is not an object/
);
},
/"result.stats" element is not an object/
);
done
();
done
();
});
});
it
(
'options.indentWidth not provided'
,
function
(
done
)
{
var
options
=
{
data
:
'div { width: 10px; } '
,
sourceComments
:
false
,
file
:
null
,
outFile
:
null
,
includePaths
:
''
,
precision
:
5
,
sourceMap
:
null
,
style
:
0
,
/* indentWidth */
indentType
:
0
,
linefeed
:
'
\
n'
,
result
:
{
stats
:
{}
}
};
binding
.
renderSync
(
options
);
done
();
});
});
// lowlevel
});
// lowlevel
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