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
e403fe36
Commit
e403fe36
authored
Apr 07, 2015
by
Adeel Mujahid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #837 from am11/master
Code: Don't throw from interim callback state
parents
8799d951
fcb50b09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
binding.cpp
src/binding.cpp
+0
-8
custom_importer_bridge.cpp
src/custom_importer_bridge.cpp
+3
-1
No files found.
src/binding.cpp
View file @
e403fe36
...
...
@@ -122,10 +122,6 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
for
(
size_t
i
=
0
;
i
<
importers
->
Length
();
++
i
)
{
Local
<
Function
>
callback
=
Local
<
Function
>::
Cast
(
importers
->
Get
(
static_cast
<
uint32_t
>
(
i
)));
if
(
!
callback
->
IsFunction
())
{
NanThrowError
(
NanNew
(
"options.importer must be set to a function or array of functions"
));
}
auto
bridge
=
std
::
make_shared
<
CustomImporterBridge
>
(
new
NanCallback
(
callback
),
ctx_w
->
is_sync
);
ctx_w
->
importer_bridges
.
push_back
(
bridge
);
...
...
@@ -147,10 +143,6 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
Local
<
String
>
signature
=
Local
<
String
>::
Cast
(
signatures
->
Get
(
NanNew
(
i
)));
Local
<
Function
>
callback
=
Local
<
Function
>::
Cast
(
functions
->
Get
(
signature
));
if
(
!
signature
->
IsString
()
||
!
callback
->
IsFunction
())
{
NanThrowError
(
NanNew
(
"options.functions must be a (signature -> function) hash"
));
}
auto
bridge
=
std
::
make_shared
<
CustomFunctionBridge
>
(
new
NanCallback
(
callback
),
ctx_w
->
is_sync
);
ctx_w
->
function_bridges
.
push_back
(
bridge
);
...
...
src/custom_importer_bridge.cpp
View file @
e403fe36
...
...
@@ -17,7 +17,9 @@ SassImportList CustomImporterBridge::post_process_return_value(Handle<Value> val
Local
<
Value
>
value
=
array
->
Get
(
static_cast
<
uint32_t
>
(
i
));
if
(
!
value
->
IsObject
())
{
NanThrowError
(
NanNew
(
"returned array must only contain object literals"
));
auto
entry
=
sass_make_import_entry
(
0
,
0
,
0
);
sass_import_set_error
(
entry
,
"returned array must only contain object literals"
,
-
1
,
-
1
);
continue
;
}
Local
<
Object
>
object
=
Local
<
Object
>::
Cast
(
value
);
...
...
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