Define() public method

Defines the require() function as a global in the current context.
public Define ( ) : void
return void
Ejemplo n.º 1
0
      private static CSharp.Context SetupContext(ResourceHelper resourceHelper)
      {
         var context = new CSharp.Context();

         context.CreatePrintFunction();

         var require = new RequireDefinition(context, resourceHelper);
         require.Define();

         return context;
      }
Ejemplo n.º 2
0
      private static CSharp.Context SetupContext(ResourceHelper resourceHelper)
      {
         var context = new CSharp.Context();

         //context.CreatePrintFunction();
         // Debug.registerConsolePrinter();
         // IronJS.Support.Debug.registerAstPrinter(AstPrinter);
         // IronJS.Support.Debug.registerExprPrinter(ExprPrinter);
         
         ConsoleConstructor.AttachToContext(context);
          var require = new RequireDefinition(context, resourceHelper);
         require.Define();

         return context;
      }