[
https://issues.apache.org/jira/browse/TINKERPOP-3186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031249#comment-18031249
]
ASF GitHub Bot commented on TINKERPOP-3186:
-------------------------------------------
andreachild commented on code in PR #3242:
URL: https://github.com/apache/tinkerpop/pull/3242#discussion_r2446029771
##########
gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/structure-types-test.js:
##########
@@ -32,6 +32,18 @@ describe('Edge', () => {
assert.strictEqual(element.toString(), `e[123][?-label1->?]`);
});
});
+
+ describe('properties', () => {
+ it('should default to empty array when not provided', () => {
+ const edge = new Edge('123', new Vertex(1), 'knows', new Vertex(2));
+ assert.deepStrictEqual(edge.properties, []);
+ });
+
+ it('should default to empty array when null', () => {
Review Comment:
```suggestion
it('should default to empty array when undefined', () => {
```
> Inconsistency of properties data type on Element
> ------------------------------------------------
>
> Key: TINKERPOP-3186
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3186
> Project: TinkerPop
> Issue Type: Improvement
> Components: javascript
> Affects Versions: 3.7.4
> Reporter: Stephen Mallette
> Assignee: Stephen Mallette
> Priority: Blocker
> Labels: breaking
>
> The {{properties}} property on {{Element}} in javascript has datatypes
> inconsistent with Java and other GLVs where it can be a {{Map}}, {{List}} or
> {{undefined}} depending on serializer or other factors (and we go through
> great lengths to assert all of this in tests for some reason). The type
> should be {{List}}. Use an empty list if {{null}} or {{undefined}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)