[seed] Sandbox : set up __script_path__ in new context



commit 5b169f4086f735a9921f4c049e66cf3d264dca38
Author: Jonatan Liljedahl <lijon kymatica com>
Date:   Wed Jun 30 10:08:17 2010 +0800

    Sandbox : set up __script_path__ in new context
    
    Sets the __script_path__ to be the same as the calling scripts path for new Contexts.

 modules/sandbox/seed-sandbox.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/modules/sandbox/seed-sandbox.c b/modules/sandbox/seed-sandbox.c
index b33e57d..a1c80a6 100644
--- a/modules/sandbox/seed-sandbox.c
+++ b/modules/sandbox/seed-sandbox.c
@@ -84,6 +84,10 @@ seed_sandbox_context_add_globals (SeedContext ctx,
     }
   seed_prepare_global_context (c);
 
+  SeedObject g = seed_context_get_global_object (c);
+  SeedObject global = seed_context_get_global_object (ctx);
+  seed_object_set_property (c, g, "__script_path__", seed_object_get_property (ctx, global, "__script_path__"));
+    
   return seed_make_null (ctx);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]