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
b0013a00
Commit
b0013a00
authored
Dec 18, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Importer: Adds support for previous.
parent
eedc835d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
index.js
lib/index.js
+2
-2
binding.cpp
src/binding.cpp
+4
-2
sass_context_wrapper.cpp
src/sass_context_wrapper.cpp
+1
-0
sass_context_wrapper.h
src/sass_context_wrapper.h
+1
-0
No files found.
lib/index.js
View file @
b0013a00
...
@@ -173,8 +173,8 @@ function getOptions(options) {
...
@@ -173,8 +173,8 @@ function getOptions(options) {
};
};
if
(
importer
)
{
if
(
importer
)
{
options
.
importer
=
function
(
file
,
key
)
{
options
.
importer
=
function
(
file
,
prev
,
key
)
{
importer
(
file
,
function
(
data
)
{
importer
(
file
,
prev
,
function
(
data
)
{
binding
.
importedCallback
({
binding
.
importedCallback
({
index
:
key
,
index
:
key
,
objectLiteral
:
data
objectLiteral
:
data
...
...
src/binding.cpp
View file @
b0013a00
...
@@ -25,21 +25,23 @@ void dispatched_async_uv_callback(uv_async_t *req){
...
@@ -25,21 +25,23 @@ void dispatched_async_uv_callback(uv_async_t *req){
Handle
<
Value
>
argv
[]
=
{
Handle
<
Value
>
argv
[]
=
{
NanNew
<
String
>
(
strdup
(
ctx_w
->
file
)),
NanNew
<
String
>
(
strdup
(
ctx_w
->
file
)),
NanNew
<
String
>
(
strdup
(
ctx_w
->
prev
)),
NanNew
<
Number
>
(
imports_collection
.
size
()
-
1
)
NanNew
<
Number
>
(
imports_collection
.
size
()
-
1
)
};
};
NanNew
<
Value
>
(
ctx_w
->
importer_callback
->
Call
(
2
,
argv
));
NanNew
<
Value
>
(
ctx_w
->
importer_callback
->
Call
(
3
,
argv
));
if
(
try_catch
.
HasCaught
())
{
if
(
try_catch
.
HasCaught
())
{
node
::
FatalException
(
try_catch
);
node
::
FatalException
(
try_catch
);
}
}
}
}
struct
Sass_Import
**
sass_importer
(
const
char
*
file
,
void
*
cookie
)
struct
Sass_Import
**
sass_importer
(
const
char
*
file
,
const
char
*
prev
,
void
*
cookie
)
{
{
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
cookie
);
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
cookie
);
ctx_w
->
file
=
strdup
(
file
);
ctx_w
->
file
=
strdup
(
file
);
ctx_w
->
prev
=
strdup
(
prev
);
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
);
...
...
src/sass_context_wrapper.cpp
View file @
b0013a00
...
@@ -43,6 +43,7 @@ extern "C" {
...
@@ -43,6 +43,7 @@ extern "C" {
delete
ctx_w
->
error_callback
;
delete
ctx_w
->
error_callback
;
delete
ctx_w
->
importer_callback
;
delete
ctx_w
->
importer_callback
;
delete
ctx_w
->
file
;
delete
ctx_w
->
file
;
delete
ctx_w
->
prev
;
delete
ctx_w
->
cookie
;
delete
ctx_w
->
cookie
;
uv_mutex_destroy
(
&
ctx_w
->
importer_mutex
);
uv_mutex_destroy
(
&
ctx_w
->
importer_mutex
);
...
...
src/sass_context_wrapper.h
View file @
b0013a00
...
@@ -20,6 +20,7 @@ extern "C" {
...
@@ -20,6 +20,7 @@ extern "C" {
uv_cond_t
importer_condition_variable
;
uv_cond_t
importer_condition_variable
;
uv_async_t
async
;
uv_async_t
async
;
const
char
*
file
;
const
char
*
file
;
const
char
*
prev
;
void
*
cookie
;
void
*
cookie
;
Sass_Import
**
imports
;
Sass_Import
**
imports
;
NanCallback
*
success_callback
;
NanCallback
*
success_callback
;
...
...
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