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
d97b611a
Commit
d97b611a
authored
May 22, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed an error in the refactored clone method. Now it deep-copies for real.
parent
5fb94280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
node_factory.cpp
node_factory.cpp
+3
-1
test_node_factory.cpp
test_node_factory.cpp
+13
-1
No files found.
node_factory.cpp
View file @
d97b611a
...
@@ -16,10 +16,12 @@ namespace Sass {
...
@@ -16,10 +16,12 @@ namespace Sass {
Node_Impl
*
Node_Factory
::
alloc_Node_Impl
(
Node_Impl
*
ip
)
Node_Impl
*
Node_Factory
::
alloc_Node_Impl
(
Node_Impl
*
ip
)
{
{
Node_Impl
*
ip_cpy
=
new
Node_Impl
(
*
ip
);
Node_Impl
*
ip_cpy
=
new
Node_Impl
(
*
ip
);
pool_
.
push_back
(
ip_cpy
);
if
(
ip_cpy
->
has_children
)
{
if
(
ip_cpy
->
has_children
)
{
for
(
size_t
i
=
0
,
S
=
ip_cpy
->
size
();
i
<
S
;
++
i
)
{
for
(
size_t
i
=
0
,
S
=
ip_cpy
->
size
();
i
<
S
;
++
i
)
{
Node
n
(
ip_cpy
->
at
(
i
));
Node
n
(
ip_cpy
->
at
(
i
));
n
.
ip_
=
alloc_Node_Impl
(
n
.
ip_
);
// n.ip_ = alloc_Node_Impl(n.ip_);
ip_cpy
->
at
(
i
)
=
(
*
this
)(
n
);
}
}
}
}
return
ip_cpy
;
return
ip_cpy
;
...
...
test_node_factory.cpp
View file @
d97b611a
...
@@ -48,7 +48,19 @@ int main()
...
@@ -48,7 +48,19 @@ int main()
cout
<<
num4
[
3
].
numeric_value
()
<<
endl
;
cout
<<
num4
[
3
].
numeric_value
()
<<
endl
;
num4
[
3
]
=
new_Node
(
""
,
0
,
0.4567
);
num4
[
3
]
=
new_Node
(
""
,
0
,
0.4567
);
cout
<<
num3
[
3
].
numeric_value
()
<<
endl
;
cout
<<
num3
[
3
].
numeric_value
()
<<
endl
;
cout
<<
num4
[
3
].
numeric_value
()
<<
endl
;
cout
<<
num4
[
3
].
numeric_value
()
<<
endl
<<
endl
;
Node
block1
(
new_Node
(
Node
::
block
,
"block"
,
1
,
2
));
block1
<<
num2
<<
num4
;
Node
block2
(
new_Node
(
block1
));
cout
<<
(
block1
==
block2
)
<<
endl
;
cout
<<
block1
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
;
block2
[
1
][
3
]
=
new_Node
(
""
,
0
,
.9876
);
cout
<<
block1
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
;
new_Node
.
free
();
new_Node
.
free
();
...
...
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