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
1d597d5f
Commit
1d597d5f
authored
Nov 22, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Importer: Fixes issue with casting.
parent
800738a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
binding.cpp
src/binding.cpp
+4
-4
sass_context_wrapper.cpp
src/sass_context_wrapper.cpp
+1
-1
sass_context_wrapper.h
src/sass_context_wrapper.h
+1
-1
No files found.
src/binding.cpp
View file @
1d597d5f
#include<iostream>
#include <nan.h>
#include <nan.h>
#include "sass_context_wrapper.h"
#include "sass_context_wrapper.h"
...
@@ -19,7 +20,7 @@ void dispatched_async_uv_callback(uv_async_t *req){
...
@@ -19,7 +20,7 @@ void dispatched_async_uv_callback(uv_async_t *req){
TryCatch
try_catch
;
TryCatch
try_catch
;
Handle
<
Value
>
argv
[]
=
{
Handle
<
Value
>
argv
[]
=
{
NanNew
<
String
>
(
ctx_w
->
file
)
NanNew
<
String
>
(
strdup
(
ctx_w
->
file
)
)
};
};
Local
<
Value
>
returned_value
=
NanNew
<
Value
>
(
ctx_w
->
importer_callback
->
Call
(
1
,
argv
));
Local
<
Value
>
returned_value
=
NanNew
<
Value
>
(
ctx_w
->
importer_callback
->
Call
(
1
,
argv
));
...
@@ -67,13 +68,12 @@ struct Sass_Import** sass_importer(const char* file, void* cookie)
...
@@ -67,13 +68,12 @@ struct Sass_Import** sass_importer(const char* file, void* cookie)
{
{
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
cookie
);
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
cookie
);
uv_mutex_t
t
;
ctx_w
->
importer_mutex
->
lock
();
ctx_w
->
importer_mutex
->
lock
();
//uv_mutex_lock(ctx_w->mutex);
//uv_mutex_lock(ctx_w->mutex);
// Enter critical section
// Enter critical section
ctx_w
->
file
=
file
;
ctx_w
->
file
=
strdup
(
file
)
;
ctx_w
->
async
.
data
=
(
void
*
)
&
ctx_w
;
ctx_w
->
async
.
data
=
(
void
*
)
ctx_w
;
uv_async_send
(
&
ctx_w
->
async
);
uv_async_send
(
&
ctx_w
->
async
);
// Reassurances
// Reassurances
...
...
src/sass_context_wrapper.cpp
View file @
1d597d5f
...
@@ -24,7 +24,7 @@ extern "C" {
...
@@ -24,7 +24,7 @@ extern "C" {
sass_context_wrapper
*
sass_make_context_wrapper
()
{
sass_context_wrapper
*
sass_make_context_wrapper
()
{
// (sass_context_wrapper*) calloc(1, sizeof(sass_context_wrapper));
// (sass_context_wrapper*) calloc(1, sizeof(sass_context_wrapper));
auto
ctx_w
=
(
sass_context_wrapper
*
)
calloc
(
1
,
sizeof
(
sass_context_wrapper
));
auto
ctx_w
=
(
sass_context_wrapper
*
)
calloc
(
1
,
sizeof
(
sass_context_wrapper
));
ctx_w
->
importer_mutex
=
new
std
::
recursive_
mutex
();
ctx_w
->
importer_mutex
=
new
std
::
mutex
();
return
ctx_w
;
return
ctx_w
;
}
}
...
...
src/sass_context_wrapper.h
View file @
1d597d5f
...
@@ -17,7 +17,7 @@ struct sass_context_wrapper {
...
@@ -17,7 +17,7 @@ struct sass_context_wrapper {
Sass_File_Context
*
fctx
;
Sass_File_Context
*
fctx
;
Persistent
<
Object
>
stats
;
Persistent
<
Object
>
stats
;
uv_work_t
request
;
uv_work_t
request
;
std
::
recursive_
mutex
*
importer_mutex
;
std
::
mutex
*
importer_mutex
;
//uv_mutex_t* mutex;
//uv_mutex_t* mutex;
uv_async_t
async
;
uv_async_t
async
;
const
char
*
file
;
const
char
*
file
;
...
...
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