Skip to content

Commit a70d6aa

Browse files
committed
include optional source on returned stylesheet object (fixes #85)
1 parent dd81540 commit a70d6aa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/parse/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ module.exports = function(css, options){
8383
return {
8484
type: 'stylesheet',
8585
stylesheet: {
86+
source: options.source,
8687
rules: rulesList,
8788
parsingErrors: errorsList
8889
}

test/parse.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ describe('parse(str)', function() {
88
source: 'booty.css'
99
});
1010

11+
ast.stylesheet.source.should.equal('booty.css');
12+
1113
var position = ast.stylesheet.rules[0].position;
1214
position.start.should.be.ok;
1315
position.end.should.be.ok;
@@ -53,7 +55,7 @@ describe('parse(str)', function() {
5355
});
5456

5557
it('should list the parsing errors and continue parsing', function() {
56-
var result = parse('foo { color= red; } bar { color: blue; } baz {}} boo { display: none}', {
58+
var result = parse('foo { color= red; } bar { color: blue; } baz {}} boo { display: none}', {
5759
silent: true,
5860
source: 'foo.css'
5961
});

0 commit comments

Comments
 (0)