(processor, css, opts)
| 58 | } |
| 59 | |
| 60 | constructor(processor, css, opts) { |
| 61 | css = css.toString() |
| 62 | this.stringified = false |
| 63 | |
| 64 | this._processor = processor |
| 65 | this._css = css |
| 66 | this._opts = opts |
| 67 | this._map = undefined |
| 68 | |
| 69 | let str = stringify |
| 70 | this.result = new Result(this._processor, undefined, this._opts) |
| 71 | this.result.css = css |
| 72 | |
| 73 | let self = this |
| 74 | Object.defineProperty(this.result, 'root', { |
| 75 | get() { |
| 76 | return self.root |
| 77 | } |
| 78 | }) |
| 79 | |
| 80 | let map = new MapGenerator(str, undefined, this._opts, css) |
| 81 | if (map.isMap()) { |
| 82 | let [generatedCSS, generatedMap] = map.generate() |
| 83 | if (generatedCSS) { |
| 84 | this.result.css = generatedCSS |
| 85 | } |
| 86 | if (generatedMap) { |
| 87 | this.result.map = generatedMap |
| 88 | } |
| 89 | } else { |
| 90 | map.clearAnnotation() |
| 91 | this.result.css = map.css |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | async() { |
| 96 | if (this.error) return Promise.reject(this.error) |
nothing calls this directly
no test coverage detected