You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Item 1 is a Slot. This should work I think but maybe this is not what you want to do? assertEquals(context.eval("js", "record.getItem(1).stringValue().asString()"), "number"); assertEquals(context.eval("js", "record.getItem(1).key.numberValue()").asInt(), 78);
I committed my code with HostItem.java and ItemTypeSpec.java. I converted all methods in Item.java with corresponding functionalities in Item.ts, but I listed some left over questions I had while developing, we can sync when you in the office. At the meantime, I'll keep working on the rest of the list:
In Item.ts, there're only stringValue(), numberValue(), and booleanValue(). But in Item.java, besides those three methods, there're byteValue(), shortValue(), intValue(), longValue(), floatValue(), doubleValue(), integerValue(), charValue(). I added those in HostItem.java, but not sure whether I should keep them there cause there's no corresponding method in Item.ts.
If we want to keep those method in HostItem, I also met a problem while writing test case with integerValue(), need your instruction.
Met problem with writing HostLambda test case
For HostItemFilter, HostItemEvaluate, HostItemSubstitute, they involved with Selector and Interpreter bindings, need your instruction
For HostItemCast, HostItemCoerce, HostItemDisplay, HostItemDebug, HostItemGlobalScope need your instruction for test case
For HostItemFromObject test case, I met question with test case that fromObject() takes map as parameter with following error exception:
Map<String, String> map = new HashMap<>();
map.put("foo", "bar");
bindings.putMember("mapOb", bridge.hostToGuest(Item.fromObject(map)));
assertEquals(bridge.guestToHost(context.eval("js", "mapOb")), Slot.of("foo", "bar"));
error:
swim.dynamic.structure.ItemTypeSpec > testFromObject FAILED
java.lang.IllegalArgumentException: {foo=bar}
at swim.structure/swim.structure.Value.fromObject(Value.java:1049)
at swim.structure/swim.structure.Item.fromObject(Item.java:943)
at swim.dynamic.structure/
swim.dynamic.structure.ItemTypeSpec.testFromObject(ItemTypeSpec.java:87)
Flesh out polyglot language bindings for the swim-structure Java library. The bindings are located in the swim-dynamic-structure Java library. The JavaScript bindings should be compatible with the @swim/structure TypeScript library. Make sure to bind static methods, in addition to instance methods.
Structure bindings
Item
bindings.Field
bindings.Attr
bindings.Slot
bindings.Value
bindingsRecord
bindingsData
bindings.Text
bindings.Num
bindings.Bool
bindings.Extant
bindings.Absent
bindings.Expression bindings
Expression
bindings.Operator
bindings.Selector
bindings.Func
bindings.Interpreter
bindings.Form bindings
Form
bindings.The text was updated successfully, but these errors were encountered: