Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
733 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Tobias Koppers @sokra
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | module.exports = function createInnerContext(
|
---|
| 9 | options,
|
---|
| 10 | message,
|
---|
| 11 | messageOptional
|
---|
| 12 | ) {
|
---|
| 13 | let messageReported = false;
|
---|
| 14 | let innerLog = undefined;
|
---|
| 15 | if (options.log) {
|
---|
| 16 | if (message) {
|
---|
| 17 | innerLog = msg => {
|
---|
| 18 | if (!messageReported) {
|
---|
| 19 | options.log(message);
|
---|
| 20 | messageReported = true;
|
---|
| 21 | }
|
---|
| 22 | options.log(" " + msg);
|
---|
| 23 | };
|
---|
| 24 | } else {
|
---|
| 25 | innerLog = options.log;
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
| 28 | const childContext = {
|
---|
| 29 | log: innerLog,
|
---|
| 30 | fileDependencies: options.fileDependencies,
|
---|
| 31 | contextDependencies: options.contextDependencies,
|
---|
| 32 | missingDependencies: options.missingDependencies,
|
---|
| 33 | stack: options.stack
|
---|
| 34 | };
|
---|
| 35 | return childContext;
|
---|
| 36 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.