Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/webidl-contiguous): generate valid fragments (closes #1120) #1132

Merged
merged 2 commits into from Mar 7, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions js/core/webidl-contiguous.js
Expand Up @@ -898,9 +898,7 @@ define(
defn.arguments.filter(function(arg) {
return !typeIsWhitespace(arg.type);
}).map(function(arg) {
var optional = arg.optional ? "optional-" : "";
var variadic = arg.variadic ? "..." : "";
return optional + idlType2Text(arg.idlType).toLowerCase() + variadic;
return arg.name.toLowerCase();
}).join(",").replace(/\s/g, "_") + ")");
break;
case "maplike":
Expand Down
28 changes: 25 additions & 3 deletions tests/spec/core/biblio-db-spec.js
Expand Up @@ -18,6 +18,28 @@ describe("Core - biblioDB", () => {
"id": "ADD-ALL-TEST",
"title": "ADD ALL TEST",
},
"DAHU": {
"aliasOf": "DAHUT",
},
"DAHUT": {
"authors": [
"Robin Berjon"
],
"etAl": true,
"title": "The Dahut Specification Example From the Higher Circle",
"date": "15 March 1977",
"status": "Lazy Daft (Work for progress)",
"href": "http://berjon.com/",
"versions": [
"DAHUT-TEST6",
"DAHUT-TEST5",
"DAHUT-TEST4",
"DAHUT-TEST3",
"DAHUT-TEST2",
"DAHUT-TEST1"
],
"id": "DAHUT",
}
};
var biblioDB;
beforeAll((done) => {
Expand Down Expand Up @@ -216,10 +238,10 @@ describe("Core - biblioDB", () => {
biblioDB
.addAll(data)
.then(
() => biblioDB.find("WHATWG-DOM")
() => biblioDB.find("DAHU")
)
.then(
result => expect(result.id).toEqual("WHATWG-DOM")
result => expect(result.id).toEqual("DAHUT")
)
.then(
() => biblioDB.find("whatwg-dom") // alias
Expand All @@ -243,7 +265,7 @@ describe("Core - biblioDB", () => {
p3.catch(err => expect(err instanceof TypeError).toBe(true)),
]).then(done);
});
it("resolves known aliases or return null when alias is unknown", (done)=>{
it("resolves known aliases or return null when alias is unknown", (done) => {
biblioDB
.addAll(data)
.then(
Expand Down
3 changes: 1 addition & 2 deletions tests/spec/core/webidl-contiguous-spec.js
Expand Up @@ -397,8 +397,7 @@ describe("Core - Contiguous WebIDL", function() {
expect(ulls.last().children("a").attr("href"))
.toEqual("#dom-methbasic-ull!overload-1");
expect($target.find(".idlMethod:contains('paramed')").attr("id"))
.toEqual("idl-def-methbasic-paramed(superstar[][]?[],bytestring?,optional-short," +
"short[],short[][][][],optional-short,optional-domstring,short...)");
.toEqual("idl-def-methbasic-paramed(one,ext,maybe,shorts,hypercubes,defaulted,defaulted2,variable)");
expect($target.find(":contains('dates')").filter("a").length)
.toEqual(0);
done();
Expand Down