Skip to content

Commit

Permalink
Use class name 'global' when marshalling global, so that it appears i…
Browse files Browse the repository at this point in the history
…n the console for the global object
  • Loading branch information
provegard committed Apr 11, 2018
1 parent 7c82bff commit b927486
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ class Marshaller(mappingRegistry: MappingRegistry, cache: MarshallerCache = Mars
case _ =>
toObject(mirror)
}
case "global" =>
ObjectNode("global", objectId(value))
case _ =>
toObject(mirror)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class RealMarshallerTest extends RealMarshallerTestFixture with Inside with Tabl
("Java object", "new java.util.ArrayList()", "java.util.ArrayList"),
("JSObject object", s"createInstance('${classOf[ObjectLikeJSObject].getName}')", "Object"),
("JS 'class'", s"(function() { return new MyClass(); function MyClass() {} })()", "MyClass"),
("DataView", "new DataView(new ArrayBuffer(10))", "DataView")
("DataView", "new DataView(new ArrayBuffer(10))", "DataView"),
("Global", "this", "global")
)

forAll(classNameCases) { (desc, expr, className) =>
Expand Down

0 comments on commit b927486

Please sign in to comment.