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 17
17
package json .shadow
18
18
19
19
import json .internal .BaseVMContext
20
- import json .{ JSJValue , JValue }
20
+ import json .{JSONAccessorProducer , JSJValue , JValue }
21
21
import scalajs .js .{JSON => NativeJSON }
22
22
import scala .scalajs .js .annotation .JSExport
23
23
import scalajs .js
@@ -34,7 +34,14 @@ object VMContext extends BaseVMContext {
34
34
35
35
def fromAny (value : Any ): JValue = JSJValue .from(value)
36
36
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
+ }
38
45
39
46
trait JValueBase { _ : JValue =>
40
47
// this adds JSON.stringify support
You can’t perform that action at this time.
0 commit comments