Cole-Greer commented on code in PR #3304:
URL: https://github.com/apache/tinkerpop/pull/3304#discussion_r2776147978


##########
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/gremlin-lang.ts:
##########
@@ -0,0 +1,102 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+import { P, TextP, EnumValue } from './traversal.js';
+import { OptionsStrategy, TraversalStrategy } from './traversal-strategy.js';
+
+export default class GremlinLang {
+  private gremlin: string = '';
+  private optionsStrategies: OptionsStrategy[] = [];
+  
+  constructor(toClone?: GremlinLang) {
+    if (toClone) {
+      this.gremlin = toClone.gremlin;
+      this.optionsStrategies = [...toClone.optionsStrategies];
+    }
+  }
+  
+  getOptionsStrategies(): OptionsStrategy[] {
+    return this.optionsStrategies;
+  }
+  
+  private _argAsString(arg: any): string {
+    if (arg === null || arg === undefined) return 'null';
+    if (typeof arg === 'boolean') return arg ? 'true' : 'false';
+    if (typeof arg === 'number') return String(arg);

Review Comment:
   We should also handle 
[`utils.Long`](https://github.com/apache/tinkerpop/blob/88ff81736982a7bd636a17e5a57187613feb3554/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.ts#L33)
 here to cover integers which fit into Gremlin/Java's long, but are too big for 
javascripts `number`.
   
   We will also need to further consider what to do with the small number types 
like byte, short, and float. There isn't necessarily a nice answer as the 
numeric types just don't map well into JS. I think we can leave that out of 
scope for this PR, but we will have to face it before we can get all of the 
feature tests running again.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to