From 40152398e4f2083ef97654d0e20c80b3376402c3 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 11 Mar 2019 14:30:35 +0900 Subject: [PATCH 1/3] test(lib/webidl2): nullable constant with non-primitive type --- test/syntax/baseline/nullable.json | 35 +++++++++++++++++++++++++++++- test/syntax/idl/nullable.widl | 3 ++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/test/syntax/baseline/nullable.json b/test/syntax/baseline/nullable.json index e296e63f..e36b0298 100644 --- a/test/syntax/baseline/nullable.json +++ b/test/syntax/baseline/nullable.json @@ -38,6 +38,39 @@ "termination": "" }, "extAttrs": null + }, + { + "type": "const", + "idlType": { + "type": "const-type", + "generic": null, + "nullable": { + "trivia": "" + }, + "union": false, + "idlType": "MyObject", + "baseName": "MyObject", + "escapedBaseName": "MyObject", + "prefix": null, + "postfix": null, + "separator": null, + "extAttrs": null, + "trivia": { + "base": " " + } + }, + "name": "MY_OBJECT", + "value": { + "type": "null" + }, + "trivia": { + "base": "\n ", + "name": " ", + "assign": " ", + "value": " ", + "termination": "" + }, + "extAttrs": null } ], "extAttrs": null, @@ -103,6 +136,6 @@ { "type": "eof", "value": "", - "trivia": "" + "trivia": "\n" } ] diff --git a/test/syntax/idl/nullable.widl b/test/syntax/idl/nullable.widl index ccbf625f..6c4bf068 100644 --- a/test/syntax/idl/nullable.widl +++ b/test/syntax/idl/nullable.widl @@ -1,9 +1,10 @@ // Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 interface MyConstants { const boolean? ARE_WE_THERE_YET = false; + const MyObject? MY_OBJECT = null; }; interface Node { readonly attribute DOMString? namespaceURI; // ... -}; \ No newline at end of file +}; From 4d811eef4a100a74143e432878127b47f810c98e Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 12 Mar 2019 14:21:43 +0900 Subject: [PATCH 2/3] renaming for clarification --- test/syntax/idl/nullable.widl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/syntax/idl/nullable.widl b/test/syntax/idl/nullable.widl index 6c4bf068..eeceb3f7 100644 --- a/test/syntax/idl/nullable.widl +++ b/test/syntax/idl/nullable.widl @@ -1,7 +1,7 @@ // Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 interface MyConstants { const boolean? ARE_WE_THERE_YET = false; - const MyObject? MY_OBJECT = null; + const MyPrimitive? MY_NULL = null; }; interface Node { From f1ddd2a15f8d101a0601357f81902015ebe1f65d Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 12 Mar 2019 14:33:08 +0900 Subject: [PATCH 3/3] renaming in the baseline --- test/syntax/baseline/nullable.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/syntax/baseline/nullable.json b/test/syntax/baseline/nullable.json index e36b0298..eb9a31ae 100644 --- a/test/syntax/baseline/nullable.json +++ b/test/syntax/baseline/nullable.json @@ -48,9 +48,9 @@ "trivia": "" }, "union": false, - "idlType": "MyObject", - "baseName": "MyObject", - "escapedBaseName": "MyObject", + "idlType": "MyPrimitive", + "baseName": "MyPrimitive", + "escapedBaseName": "MyPrimitive", "prefix": null, "postfix": null, "separator": null, @@ -59,7 +59,7 @@ "base": " " } }, - "name": "MY_OBJECT", + "name": "MY_NULL", "value": { "type": "null" },