Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.2.1 - 2015-11-24

- Fix a bug that was caused by overwriting the base element. This is now accomplished in another way.

# 0.2.0 - 2015-11-24

- Add support for the `sourceMap` element attribute.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minim-parse-result",
"version": "0.2.0",
"version": "0.2.1",
"description": "Minim Parse Result Namespace",
"main": "./lib/parse-result.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"devDependencies": {
"chai": "^3.2.0",
"coveralls": "^2.11.2",
"minim": "^0.12.1",
"minim": "^0.12.2",
"peasant": "^0.5.2"
},
"author": "Apiary.io <support@apiary.io>",
Expand Down
19 changes: 2 additions & 17 deletions src/parse-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,10 @@ export function namespace(options) {
const ArrayElement = minim.getElementClass('array');
const StringElement = minim.getElementClass('string');

// First, modify the base and all currently registered elements to include
// First, modify the default list of special attributes to include
// the new `sourceMap` attribute, which is an unrefracted array of
// refracted source map elements.
minim.BaseElement = class SourceMappedBase extends minim.BaseElement {
constructor() {
super(...arguments);
this._attributeElementArrayKeys.push('sourceMap');
}
};

Object.keys(minim.elementMap).forEach((key) => {
const ElementClass = minim.elementMap[key];
minim.elementMap[key] = class SourceMapped extends ElementClass {
constructor() {
super(...arguments);
this._attributeElementArrayKeys.push('sourceMap');
}
};
});
minim._attributeElementArrayKeys.push('sourceMap');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a certain element can either be refracted or non-refracted in the same namespace? Tieing this into my other argument: refractproject/minim#86 (comment)


class ParseResult extends ArrayElement {
constructor() {
Expand Down