Skip to content

Commit

Permalink
fix: add prefix member to HarmonyExportExpression schema (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjweigle authored and mzgoddard committed Dec 9, 2018
1 parent ffe2e64 commit fef1488
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
12 changes: 7 additions & 5 deletions lib/SerializerAppend.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,13 @@ class AppendSerializer {
}

return _lock(_this, mustLock, promise =>
promise.then(() => _read()).catch(e =>
_closeLog(_this).then(() => {
throw e;
}),
),
promise
.then(() => _read())
.catch(e =>
_closeLog(_this).then(() => {
throw e;
}),
),
);
}

Expand Down
11 changes: 6 additions & 5 deletions lib/TransformBasicDependencyPluginLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const DependencySchemas2 = [
'originModule',
'range',
'rangeStatement',
'prefix',
],
['HarmonyExportHeaderDependency', 'range', 'rangeStatement'],
[
Expand Down Expand Up @@ -248,6 +249,7 @@ const DependencySchemas3 = [
'originModule',
'range',
'rangeStatement',
'prefix',
],
['HarmonyExportHeaderDependency', 'range', 'rangeStatement'],
[
Expand Down Expand Up @@ -692,11 +694,10 @@ class TransformBasicDependencyPluginLegacy {
if (frozen && dependency.getWarnings) {
const warnings = dependency.getWarnings();
if (warnings && warnings.length) {
frozen.warnings = warnings.map(
({ stack }) =>
stack.includes('\n at pluginCompat.tap')
? stack.split('\n at pluginCompat.tap')[0]
: stack.split('\n at Compiler.pluginCompat.tap')[0],
frozen.warnings = warnings.map(({ stack }) =>
stack.includes('\n at pluginCompat.tap')
? stack.split('\n at pluginCompat.tap')[0]
: stack.split('\n at Compiler.pluginCompat.tap')[0],
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/schema-4/basic-dependency.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"HarmonyExportExpressionDependency",
"originModule",
"range",
"rangeStatement"
"rangeStatement",
"prefix"
],
["HarmonyExportHeaderDependency", "range", "rangeStatement"],
[
Expand Down
2 changes: 2 additions & 0 deletions lib/schema-4/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,15 @@ const HarmonyExportExpressionDependencySerial = serial.serial('HarmonyExportExpr
originModule: null,
range: dependency.range,
rangeStatement: dependency.rangeStatement,
prefix: dependency.prefix,
};
},
thaw(thawed, frozen, extra, methods) {
return new HarmonyExportExpressionDependency(
extra.module,
frozen.range,
frozen.rangeStatement,
frozen.prefix,
);
},
},
Expand Down
10 changes: 4 additions & 6 deletions lib/util/parity.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,10 @@ class ParityCache {
}

const createParityToken = (id, ids = null) => {
const token = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
/[xy]/g,
c =>
c === 'x'
? ((Math.random() * 16) | 0).toString(16)
: (((Math.random() * 4) | 0) + 8).toString(16),
const token = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c =>
c === 'x'
? ((Math.random() * 16) | 0).toString(16)
: (((Math.random() * 4) | 0) + 8).toString(16),
);

return new ParityToken(id, token, ids);
Expand Down

0 comments on commit fef1488

Please sign in to comment.