mirror of
https://github.com/hanzoai/postcss.git
synced 2026-09-24 17:01:56 +00:00
Revert changes to document and root
This commit is contained in:
+3
-21
@@ -2,7 +2,7 @@
|
||||
|
||||
let Container = require('./container')
|
||||
|
||||
let LazyResult, NoWork, Processor
|
||||
let LazyResult, Processor
|
||||
|
||||
class Document extends Container {
|
||||
constructor(defaults) {
|
||||
@@ -15,23 +15,9 @@ class Document extends Container {
|
||||
}
|
||||
|
||||
toResult(opts = {}) {
|
||||
let result
|
||||
let lazy = new LazyResult(new Processor(), this, opts)
|
||||
|
||||
if (
|
||||
typeof opts.plugins === 'undefined' &&
|
||||
typeof opts.parser === 'undefined' &&
|
||||
typeof opts.stringifier === 'undefined' &&
|
||||
typeof opts.syntax === 'undefined' &&
|
||||
// @TODO what to do with this warning option? do we need it here and in processor.js?
|
||||
// Seems like we will not have a warning after NoWork is properly implemented.
|
||||
!opts.hideNothingWarning
|
||||
) {
|
||||
result = new NoWork(new Processor(), this, opts)
|
||||
} else {
|
||||
result = new LazyResult(new Processor(), this, opts)
|
||||
}
|
||||
|
||||
return result.stringify()
|
||||
return lazy.stringify()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +25,6 @@ Document.registerLazyResult = dependant => {
|
||||
LazyResult = dependant
|
||||
}
|
||||
|
||||
Document.registerNoWork = dependant => {
|
||||
NoWork = dependant
|
||||
}
|
||||
|
||||
Document.registerProcessor = dependant => {
|
||||
Processor = dependant
|
||||
}
|
||||
|
||||
+3
-20
@@ -2,7 +2,7 @@
|
||||
|
||||
let Container = require('./container')
|
||||
|
||||
let LazyResult, NoWork, Processor
|
||||
let LazyResult, Processor
|
||||
|
||||
class Root extends Container {
|
||||
constructor(defaults) {
|
||||
@@ -42,21 +42,8 @@ class Root extends Container {
|
||||
}
|
||||
|
||||
toResult(opts = {}) {
|
||||
let result
|
||||
|
||||
if (
|
||||
typeof opts.plugins === 'undefined' &&
|
||||
typeof opts.parser === 'undefined' &&
|
||||
typeof opts.stringifier === 'undefined' &&
|
||||
typeof opts.syntax === 'undefined' &&
|
||||
!opts.hideNothingWarning
|
||||
) {
|
||||
result = new NoWork(new Processor(), this, opts)
|
||||
} else {
|
||||
result = new LazyResult(new Processor(), this, opts)
|
||||
}
|
||||
|
||||
return result.stringify()
|
||||
let lazy = new LazyResult(new Processor(), this, opts)
|
||||
return lazy.stringify()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +51,6 @@ Root.registerLazyResult = dependant => {
|
||||
LazyResult = dependant
|
||||
}
|
||||
|
||||
Root.registerNoWork = dependant => {
|
||||
NoWork = dependant
|
||||
}
|
||||
|
||||
Root.registerProcessor = dependant => {
|
||||
Processor = dependant
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user