-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make lambda-based classes serializable
Add new interfaces so that native classes based on LambdaConstructor and LambdaFunction can be serialized without error.
- Loading branch information
Showing
8 changed files
with
214 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
rhino/src/main/java/org/mozilla/javascript/SerializableCallable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.mozilla.javascript; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* This interface makes it possible to pass a lambda function to the various methods in | ||
* LambdaConstructor and LambdaFunction that require a Callable that is also Serializable. Code that | ||
* works with lambdas will largely "not notice" this interface, but it will make it possible for | ||
* lambda-based classes to work with serialization like older Rhino native classes. | ||
*/ | ||
public interface SerializableCallable extends Callable, Serializable {} |
9 changes: 9 additions & 0 deletions
9
rhino/src/main/java/org/mozilla/javascript/SerializableConstructable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.mozilla.javascript; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* This interface makes it possible to pass a lambda function to the various methods in | ||
* LambdaConstructor and LambdaFunction that require a Constructable that is also Serializable. | ||
*/ | ||
public interface SerializableConstructable extends Constructable, Serializable {} |
Oops, something went wrong.