Skip to content

Commit

Permalink
Merge branch 'develop' into gh-pages
Browse files Browse the repository at this point in the history
* develop:
  v7.1.0
  chore(package): update snyk to version 1.22.1 (#995)
  feat(webidl-contiguous): Warn if IDL member lacks dfn (closes #935) (#991)
  chore(override-configuration): reformat code
  chore(include-config): reformat code
  • Loading branch information
marcoscaceres committed Dec 20, 2016
2 parents e0b857a + 24dd848 commit 7cca6f3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 45 deletions.
2 changes: 1 addition & 1 deletion builds/respec-w3c-common.build.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions builds/respec-w3c-common.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions js/core/include-config.js
Expand Up @@ -3,10 +3,10 @@

define(
["core/pubsubhub"],
function (pubsubhub) {
function(pubsubhub) {
'use strict';
return {
run: function (conf, doc, cb) {
run: function(conf, doc, cb) {
var initialUserConfig;
try {
if (Object.assign) {
Expand All @@ -17,18 +17,18 @@ define(
} catch (err) {
initialUserConfig = {};
}
pubsubhub.sub('end-all', function () {
pubsubhub.sub('end-all', function() {
var script = doc.createElement('script');
script.id = 'initialUserConfig';
var confFilter = function (key, val) {
var confFilter = function(key, val) {
// DefinitionMap contains array of DOM elements that aren't serializable
// we replace them by their id
if (key === 'definitionMap') {
var ret = {};
Object
.keys(val)
.forEach(function (k) {
ret[k] = val[k].map(function (d) {
.forEach(function(k) {
ret[k] = val[k].map(function(d) {
return d[0].id;
});
});
Expand Down
64 changes: 32 additions & 32 deletions js/core/override-configuration.js
Expand Up @@ -9,37 +9,37 @@
// There could probably be a UI for this to make it even simpler.
"use strict";
define(
[],
function() {
return {
run: function(conf, doc, cb) { //jshint ignore:line
if (!location.search) {
return cb();
}
var overrideProps = doc.location.search
//Remove "?" from search
.replace(/^\?/, "")
// The default separator is ";" for key/value pairs
.split(";")
.filter(function removeEmpties(item) {
return item.trim();
})
.reduce(function decodeKeyValues(collector, item) {
var keyValue = item.split("=", 2);
var key = decodeURIComponent(keyValue[0]);
var value = decodeURIComponent(keyValue[1].replace(/%3D/g, "="));
var parsedValue;
try {
parsedValue = JSON.parse(value);
} catch (err) {
parsedValue = value;
}
collector[key] = parsedValue;
return collector;
}, {});
Object.assign(conf, overrideProps);
cb();
[],
function() {
return {
run: function(conf, doc, cb) { //jshint ignore:line
if (!location.search) {
return cb();
}
};
}
var overrideProps = doc.location.search
//Remove "?" from search
.replace(/^\?/, "")
// The default separator is ";" for key/value pairs
.split(";")
.filter(function removeEmpties(item) {
return item.trim();
})
.reduce(function decodeKeyValues(collector, item) {
var keyValue = item.split("=", 2);
var key = decodeURIComponent(keyValue[0]);
var value = decodeURIComponent(keyValue[1].replace(/%3D/g, "="));
var parsedValue;
try {
parsedValue = JSON.parse(value);
} catch (err) {
parsedValue = value;
}
collector[key] = parsedValue;
return collector;
}, {});
Object.assign(conf, overrideProps);
cb();
}
};
}
);
5 changes: 4 additions & 1 deletion js/core/webidl-contiguous.js
Expand Up @@ -872,7 +872,10 @@ define(
if (dfns.length > 1) {
pubsubhub.pub("error", "Multiple <dfn>s for " + name + (parent ? " in " + parent : ""));
}
if (dfns.length === 0) {

if (dfns.length === 0 && name !== "serializer" && name !== "stringifier") {
const msg = "No <dfn> for " + name + (parent ? " in " + parent : "") + ".";
pubsubhub.pub("warn", msg);
return undefined;
}
var dfn = dfns[0];
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "respec",
"version": "7.0.0",
"version": "7.1.0",
"license": "W3C",
"description": "A technical specification pre-processor.",
"engines": {
Expand Down Expand Up @@ -83,7 +83,7 @@
"marked": "^0.3.6",
"nightmare": "^2.8.1",
"prompt": "^1.0.0",
"snyk": "1.21.2"
"snyk": "1.22.1"
},
"snyk": true
}

0 comments on commit 7cca6f3

Please sign in to comment.