File tree Expand file tree Collapse file tree 2 files changed +9
-31
lines changed Expand file tree Collapse file tree 2 files changed +9
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1717package json .shadow
1818
1919import json .internal .BaseVMContext
20- import json .{ JSJValue , JValue }
20+ import json .{JSONAccessorProducer , JSJValue , JValue }
2121import scalajs .js .{JSON => NativeJSON }
2222import scala .scalajs .js .annotation .JSExport
2323import scalajs .js
@@ -34,7 +34,14 @@ object VMContext extends BaseVMContext {
3434
3535 def fromAny (value : Any ): JValue = JSJValue .from(value)
3636
37- trait JValueCompanionBase
37+ trait JValueCompanionBase {
38+ implicit case object JsAnyAccessor extends JSONAccessorProducer [js.Any , JValue ] {
39+ val clazz = classOf [JValue ]
40+
41+ def createJSON (obj : js.Any ): JValue = JValue from obj
42+ def fromJSON (jValue : JValue ): js.Any = JSJValue toJS jValue
43+ }
44+ }
3845
3946 trait JValueBase { _ : JValue =>
4047 // this adds JSON.stringify support
You can’t perform that action at this time.
0 commit comments