Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.

Commit 32fca4c

Browse files
committed
Merge pull request #4 from refractproject/daniel/default-fix
Fix a bug caused by overwriting the base element
2 parents 4b01d0f + 4768bd0 commit 32fca4c

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.2.1 - 2015-11-24
2+
3+
- Fix a bug that was caused by overwriting the base element. This is now accomplished in another way.
4+
15
# 0.2.0 - 2015-11-24
26

37
- Add support for the `sourceMap` element attribute.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minim-parse-result",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Minim Parse Result Namespace",
55
"main": "./lib/parse-result.js",
66
"repository": {
@@ -23,7 +23,7 @@
2323
"devDependencies": {
2424
"chai": "^3.2.0",
2525
"coveralls": "^2.11.2",
26-
"minim": "^0.12.1",
26+
"minim": "^0.12.2",
2727
"peasant": "^0.5.2"
2828
},
2929
"author": "Apiary.io <[email protected]>",

src/parse-result.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,10 @@ export function namespace(options) {
1414
const ArrayElement = minim.getElementClass('array');
1515
const StringElement = minim.getElementClass('string');
1616

17-
// First, modify the base and all currently registered elements to include
17+
// First, modify the default list of special attributes to include
1818
// the new `sourceMap` attribute, which is an unrefracted array of
1919
// refracted source map elements.
20-
minim.BaseElement = class SourceMappedBase extends minim.BaseElement {
21-
constructor() {
22-
super(...arguments);
23-
this._attributeElementArrayKeys.push('sourceMap');
24-
}
25-
};
26-
27-
Object.keys(minim.elementMap).forEach((key) => {
28-
const ElementClass = minim.elementMap[key];
29-
minim.elementMap[key] = class SourceMapped extends ElementClass {
30-
constructor() {
31-
super(...arguments);
32-
this._attributeElementArrayKeys.push('sourceMap');
33-
}
34-
};
35-
});
20+
minim._attributeElementArrayKeys.push('sourceMap');
3621

3722
class ParseResult extends ArrayElement {
3823
constructor() {

0 commit comments

Comments
 (0)