diff --git a/README.html b/README.html index 81fcae93..5ee8fbd5 100644 --- a/README.html +++ b/README.html @@ -980,7 +980,7 @@ Files are no longer hosted at LuaForge.
  • Improve garbage collection of orphaned coroutines when yielding from debug hook functions (fixes issue #32).
  • LuaScriptEngineFactory.getScriptEngine() now returns new instance of LuaScriptEngine for each call.
  • Fix os.date("*t") to return hour in 24 hour format (fixes issue #45)
  • -
  • Add ReadOnlyTable and ReadWriteShadowTable utility classes to simplify sandboxing.
  • +
  • Add SampleSandboxed.java sample code to illustrate sandboxing techniques.
  • Make string metatable a proper metatable, and make it read-only by default.
  • Add sample code that illustrates techniques in creating sandboxed environments.
  • Add convenience methods to Global to load string scripts with custom environment.
  • diff --git a/examples/jse/SampleSandboxed.java b/examples/jse/SampleSandboxed.java index 56411dba..33bde745 100644 --- a/examples/jse/SampleSandboxed.java +++ b/examples/jse/SampleSandboxed.java @@ -6,72 +6,57 @@ import org.luaj.vm2.lib.jse.*; /** Simple program that illustrates basic sand-boxing of client scripts * in a server environment. * - *

    Although this sandboxing is done primarily in Java here, most of the - * same techniques can be done directly from lua using metatables. + *

    Although this sandboxing is done primarily in Java here, these + * same techniques should all be possible directly from lua using metatables. * - *

    This class makes particular use of two utility classes, - * {@link ReadOnlyTable} which is used to wrap shared global metatables - * such as the string metatable or the number metatable, and - * {@link ReadWriteShadowTable} which can provide a lightweight user - * environment around an arbitrarily deep shared globals instance while - * limiting the resources at startup for small scripts that use few globals. + *

    The main goals of this sandbox are: + *