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
7d62f687
Commit
7d62f687
authored
Aug 09, 2015
by
Marcin Cieslak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use As<>() instead of Cast() where appropriate
parent
a1395134
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
binding.cpp
src/binding.cpp
+3
-3
custom_importer_bridge.cpp
src/custom_importer_bridge.cpp
+4
-4
No files found.
src/binding.cpp
View file @
7d62f687
...
@@ -105,7 +105,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
...
@@ -105,7 +105,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
v8
::
Local
<
v8
::
Value
>
importer_callback
=
Nan
::
Get
(
options
,
Nan
::
New
(
"importer"
).
ToLocalChecked
()).
ToLocalChecked
();
v8
::
Local
<
v8
::
Value
>
importer_callback
=
Nan
::
Get
(
options
,
Nan
::
New
(
"importer"
).
ToLocalChecked
()).
ToLocalChecked
();
if
(
importer_callback
->
IsFunction
())
{
if
(
importer_callback
->
IsFunction
())
{
v8
::
Local
<
v8
::
Function
>
importer
=
v8
::
Local
<
v8
::
Function
>::
Cast
(
importer_callback
);
v8
::
Local
<
v8
::
Function
>
importer
=
importer_callback
.
As
<
v8
::
Function
>
(
);
auto
bridge
=
std
::
make_shared
<
CustomImporterBridge
>
(
new
Nan
::
Callback
(
importer
),
ctx_w
->
is_sync
);
auto
bridge
=
std
::
make_shared
<
CustomImporterBridge
>
(
new
Nan
::
Callback
(
importer
),
ctx_w
->
is_sync
);
ctx_w
->
importer_bridges
.
push_back
(
bridge
);
ctx_w
->
importer_bridges
.
push_back
(
bridge
);
...
@@ -115,7 +115,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
...
@@ -115,7 +115,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
sass_option_set_c_importers
(
sass_options
,
c_importers
);
sass_option_set_c_importers
(
sass_options
,
c_importers
);
}
}
else
if
(
importer_callback
->
IsArray
())
{
else
if
(
importer_callback
->
IsArray
())
{
v8
::
Local
<
v8
::
Array
>
importers
=
v8
::
Local
<
v8
::
Array
>::
Cast
(
importer_callback
);
v8
::
Local
<
v8
::
Array
>
importers
=
importer_callback
.
As
<
v8
::
Array
>
(
);
Sass_Importer_List
c_importers
=
sass_make_importer_list
(
importers
->
Length
());
Sass_Importer_List
c_importers
=
sass_make_importer_list
(
importers
->
Length
());
for
(
size_t
i
=
0
;
i
<
importers
->
Length
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
importers
->
Length
();
++
i
)
{
...
@@ -133,7 +133,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
...
@@ -133,7 +133,7 @@ void ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrap
v8
::
Local
<
v8
::
Value
>
custom_functions
=
Nan
::
Get
(
options
,
Nan
::
New
(
"functions"
).
ToLocalChecked
()).
ToLocalChecked
();
v8
::
Local
<
v8
::
Value
>
custom_functions
=
Nan
::
Get
(
options
,
Nan
::
New
(
"functions"
).
ToLocalChecked
()).
ToLocalChecked
();
if
(
custom_functions
->
IsObject
())
{
if
(
custom_functions
->
IsObject
())
{
v8
::
Local
<
v8
::
Object
>
functions
=
v8
::
Local
<
v8
::
Object
>::
Cast
(
custom_functions
);
v8
::
Local
<
v8
::
Object
>
functions
=
custom_functions
.
As
<
v8
::
Object
>
(
);
v8
::
Local
<
v8
::
Array
>
signatures
=
Nan
::
GetOwnPropertyNames
(
functions
).
ToLocalChecked
();
v8
::
Local
<
v8
::
Array
>
signatures
=
Nan
::
GetOwnPropertyNames
(
functions
).
ToLocalChecked
();
unsigned
num_signatures
=
signatures
->
Length
();
unsigned
num_signatures
=
signatures
->
Length
();
Sass_Function_List
fn_list
=
sass_make_function_list
(
num_signatures
);
Sass_Function_List
fn_list
=
sass_make_function_list
(
num_signatures
);
...
...
src/custom_importer_bridge.cpp
View file @
7d62f687
...
@@ -7,7 +7,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
...
@@ -7,7 +7,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
Nan
::
HandleScope
scope
;
Nan
::
HandleScope
scope
;
if
(
returned_value
->
IsArray
())
{
if
(
returned_value
->
IsArray
())
{
v8
::
Local
<
v8
::
Array
>
array
=
v8
::
Local
<
v8
::
Array
>::
Cast
(
returned_value
);
v8
::
Local
<
v8
::
Array
>
array
=
returned_value
.
As
<
v8
::
Array
>
(
);
imports
=
sass_make_import_list
(
array
->
Length
());
imports
=
sass_make_import_list
(
array
->
Length
());
...
@@ -20,7 +20,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
...
@@ -20,7 +20,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
continue
;
continue
;
}
}
v8
::
Local
<
v8
::
Object
>
object
=
v
8
::
Local
<
v8
::
Object
>::
Cast
(
value
);
v8
::
Local
<
v8
::
Object
>
object
=
v
alue
.
As
<
v8
::
Object
>
(
);
if
(
value
->
IsNativeError
())
{
if
(
value
->
IsNativeError
())
{
char
*
message
=
create_string
(
Nan
::
Get
(
object
,
Nan
::
New
<
v8
::
String
>
(
"message"
).
ToLocalChecked
()));
char
*
message
=
create_string
(
Nan
::
Get
(
object
,
Nan
::
New
<
v8
::
String
>
(
"message"
).
ToLocalChecked
()));
...
@@ -36,7 +36,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
...
@@ -36,7 +36,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
}
}
else
if
(
returned_value
->
IsNativeError
())
{
else
if
(
returned_value
->
IsNativeError
())
{
imports
=
sass_make_import_list
(
1
);
imports
=
sass_make_import_list
(
1
);
v8
::
Local
<
v8
::
Object
>
object
=
v8
::
Local
<
v8
::
Object
>::
Cast
(
returned_value
);
v8
::
Local
<
v8
::
Object
>
object
=
returned_value
.
As
<
v8
::
Object
>
(
);
char
*
message
=
create_string
(
Nan
::
Get
(
object
,
Nan
::
New
<
v8
::
String
>
(
"message"
).
ToLocalChecked
()));
char
*
message
=
create_string
(
Nan
::
Get
(
object
,
Nan
::
New
<
v8
::
String
>
(
"message"
).
ToLocalChecked
()));
imports
[
0
]
=
sass_make_import_entry
(
0
,
0
,
0
);
imports
[
0
]
=
sass_make_import_entry
(
0
,
0
,
0
);
...
@@ -45,7 +45,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
...
@@ -45,7 +45,7 @@ SassImportList CustomImporterBridge::post_process_return_value(v8::Local<v8::Val
}
}
else
if
(
returned_value
->
IsObject
())
{
else
if
(
returned_value
->
IsObject
())
{
imports
=
sass_make_import_list
(
1
);
imports
=
sass_make_import_list
(
1
);
imports
[
0
]
=
get_importer_entry
(
v8
::
Local
<
v8
::
Object
>::
Cast
(
returned_value
));
imports
[
0
]
=
get_importer_entry
(
returned_value
.
As
<
v8
::
Object
>
(
));
}
}
return
imports
;
return
imports
;
...
...
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