gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. be73e7767c044651bf38


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. be73e7767c044651bf38023505df175e8c02404b
Date: Thu, 07 Oct 2010 12:09:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  be73e7767c044651bf38023505df175e8c02404b (commit)
       via  2f788d7ed047d0cafd86459e53b86ec82988f3ea (commit)
       via  52440353c9580e1af1a8b87c228b6a8aba472338 (commit)
       via  a0f2f8ad94796aecf41b60d646dd42a1bfd8246a (commit)
       via  7798e1fcf93403bdec633d6bf18a401c54ba556b (commit)
       via  cd93b0126a7c7cef7ea3fecb5f6f642cbca5ca5f (commit)
       via  9e08637ddb180097b1bd7aece2626fac5f16e5f4 (commit)
       via  693b64384cff5d688933ef95c3aeb9f7b5a2de3d (commit)
       via  a6d690e2243f2f1f42bc9efec59d5bb3392e300b (commit)
       via  f316478988eab5ed46f2c54c412f13bd3e828682 (commit)
       via  3c624d76aa4bd9ace680aab8dc78f1a08235b6f2 (commit)
       via  eb5947080f6403ff98557b057d944b5138e5f621 (commit)
      from  8e6fe3e65118cbabaf6a7c7e89cc97e4192bb64f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=be73e7767c044651bf38023505df175e8c02404b


commit be73e7767c044651bf38023505df175e8c02404b
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 12:49:30 2010 +0200

    Drop useless include.

diff --git a/libcore/vm/ExecutableCode.h b/libcore/vm/ExecutableCode.h
index 7a00b4c..006532a 100644
--- a/libcore/vm/ExecutableCode.h
+++ b/libcore/vm/ExecutableCode.h
@@ -23,7 +23,6 @@
 #include <boost/noncopyable.hpp>
 
 #include "smart_ptr.h" // GNASH_USE_GC
-#include "as_function.h"
 #include "ActionExec.h"
 #include "Global_as.h"
 #include "fn_call.h"
@@ -38,7 +37,7 @@ public:
 
     ExecutableCode(DisplayObject* t) : _target(t) {}
 
-    virtual void execute()=0;
+    virtual void execute() = 0;
 
     virtual ~ExecutableCode() {}
 

http://git.savannah.gnu.org/cgit//commit/?id=2f788d7ed047d0cafd86459e53b86ec82988f3ea


commit 2f788d7ed047d0cafd86459e53b86ec82988f3ea
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 12:47:12 2010 +0200

    Documentation.

diff --git a/libcore/as_function.h b/libcore/as_function.h
index 6d1ff37..2572694 100644
--- a/libcore/as_function.h
+++ b/libcore/as_function.h
@@ -62,17 +62,21 @@ class as_function : public as_object
 {
 public:
 
-       /// Decrement refcount on the exported interface.
+    /// Destructor
        virtual ~as_function() {}
 
-       // Avoid RTTI
-       as_function* to_function() { return this; }
+    /// Return this as_object as an as_function.
+       virtual as_function* to_function() { return this; }
 
-       /// Function dispatch.  //
+       /// Function dispatch.
+    //
     /// Override from as_object, although as_objects cannot generally 
     /// be called.
        virtual as_value call(const fn_call& fn) = 0;
 
+    /// Return the string value of this as_object subclass
+    //
+    /// It's "function".
     virtual std::string stringValue() const;
 
        /// Run this function as a constructor on an object
@@ -92,7 +96,7 @@ public:
        /// @param args     Arguments for the constructor invocation
     /// @return         The constructed object. TODO: return void; currently
     ///                 there is a hack to cope with some remaining bogus
-    ///                 constructors (Microphone and Camera), which
+    ///                 constructors, which
     ///                 necessitates returning a different object from the
     ///                 passed 'this' pointer.
     as_object* construct(as_object& newobj, const as_environment& env,
@@ -103,10 +107,7 @@ public:
 
 protected:
        
-    /// Construct a function with no interface
-       //
-       /// For SWF>5 the function object will have derive from Function.
-       ///
+    /// Construct a function.
        as_function(Global_as& gl);
 
 };
@@ -128,6 +129,8 @@ as_object* constructInstance(as_function& ctor, const 
as_environment& env,
 
 /// Initialize the global Function constructor
 void function_class_init(as_object& global, const ObjectURI& uri);
+
+/// Register Function native functions.
 void registerFunctionNative(as_object& global);
 
 } // gnash namespace

http://git.savannah.gnu.org/cgit//commit/?id=52440353c9580e1af1a8b87c228b6a8aba472338


commit 52440353c9580e1af1a8b87c228b6a8aba472338
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 12:37:40 2010 +0200

    Remove VM statics and related functions. Use init_member().

diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index 32fdc57..b1a2119 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -169,9 +169,8 @@ Global_as::createFunction(Global_as::ASFunction function)
         gnash::getOwnProperty(*this, NSV::CLASS_FUNCTION).to_function();
     if (fun) {
         const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
-        f->set_member(NSV::PROP_uuPROTOuu, getMember(*fun,
-                    NSV::PROP_PROTOTYPE));
-        f->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        f->init_member(NSV::PROP_uuPROTOuu, getMember(*fun,
+                    NSV::PROP_PROTOTYPE), flags);
         f->init_member(NSV::PROP_CONSTRUCTOR, fun);
     }
     return f;
@@ -191,9 +190,8 @@ Global_as::createClass(Global_as::ASFunction ctor, 
as_object* prototype)
 
     if (fun) {
         const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
-        cl->set_member(NSV::PROP_uuPROTOuu, getMember(*fun,
-                    NSV::PROP_PROTOTYPE));
-        cl->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        cl->init_member(NSV::PROP_uuPROTOuu, getMember(*fun,
+                    NSV::PROP_PROTOTYPE), flags);
         cl->init_member(NSV::PROP_CONSTRUCTOR, fun);
     }
     return cl;
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index dfbc6a2..39a6fee 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -3293,9 +3293,8 @@ ActionDefineFunction2(ActionExec& thread)
     as_function* f = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
     if (f) {
         const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
-        func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
-                    NSV::PROP_PROTOTYPE));
-        func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        func->init_member(NSV::PROP_uuPROTOuu, getMember(*f,
+                    NSV::PROP_PROTOTYPE), flags);
         func->init_member(NSV::PROP_CONSTRUCTOR, f);
     }
 
@@ -3527,9 +3526,8 @@ ActionDefineFunction(ActionExec& thread)
     as_function* f = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
     if (f) {
         const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
-        func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
-                    NSV::PROP_PROTOTYPE));
-        func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        func->init_member(NSV::PROP_uuPROTOuu, getMember(*f,
+                    NSV::PROP_PROTOTYPE), flags);
         func->init_member(NSV::PROP_CONSTRUCTOR, f);
     }
 
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 48277e1..900fa31 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -225,12 +225,6 @@ VM::markReachableResources() const
 
        _global->setReachable();
 
-       /// Mark all static GcResources
-       for (ResVect::const_iterator i=_statics.begin(), e=_statics.end(); 
i!=e; ++i)
-       {
-               (*i)->setReachable();
-       }
-
     if (_shLib.get()) _shLib->markReachableResources();
 
 #ifdef ALLOW_GC_RUN_DURING_ACTIONS_EXECUTION
@@ -359,9 +353,7 @@ VM::getNative(unsigned int x, unsigned int y) const
 
     as_function* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
     if (func) {
-        const int flags = PropFlags::dontDelete |
-                    PropFlags::dontEnum | 
-                    PropFlags::onlySWF6Up;
+        const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
         f->init_member(NSV::PROP_uuPROTOuu, getMember(*func,
                     NSV::PROP_PROTOTYPE), flags);
         f->init_member(NSV::PROP_CONSTRUCTOR, func);
diff --git a/libcore/vm/VM.h b/libcore/vm/VM.h
index 3b3a8c7..ca9dbca 100644
--- a/libcore/vm/VM.h
+++ b/libcore/vm/VM.h
@@ -228,7 +228,6 @@ public:
        //
        /// - root movie / stage (_rootMovie)
        /// - Global object (_global)
-       /// - registered static GcResources (_statics)
        /// - Class Hierarchy object
        ///
        ///
@@ -304,17 +303,6 @@ public:
     /// Print stack, call stack, and registers to the specified ostream
     void dumpState(std::ostream& o, size_t limit = 0);
 
-#ifdef GNASH_USE_GC
-       void addStatic(GcResource* res)
-       {
-               _statics.push_back(res);
-       }
-#else  // ndef GNASH_USE_GC
-       // placeholder to avoid adding lots of
-       // compile-time switches in callers
-       void addStatic(as_object*) {}
-#endif
-
 private:
 
        friend class VmGcRoot;
@@ -349,16 +337,6 @@ private:
        /// 
        void setGlobal(Global_as*);
 
-#ifdef GNASH_USE_GC
-       /// A vector of static GcResources (typically used for built-in
-    /// class constructors)
-       //
-       /// The resources in this list will always be marked as reachable
-       ///
-       typedef std::vector< boost::intrusive_ptr<GcResource> > ResVect;
-       ResVect _statics;
-#endif
-
        typedef std::map<unsigned int, as_c_function_ptr> FuncMap;
        typedef std::map<unsigned int, FuncMap> AsNativeTable;
        AsNativeTable _asNativeTable;

http://git.savannah.gnu.org/cgit//commit/?id=a0f2f8ad94796aecf41b60d646dd42a1bfd8246a


commit a0f2f8ad94796aecf41b60d646dd42a1bfd8246a
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 12:29:38 2010 +0200

    More passes, remove all static objects.

diff --git a/libcore/as_function.cpp b/libcore/as_function.cpp
index 6c58494..a7cd208 100644
--- a/libcore/as_function.cpp
+++ b/libcore/as_function.cpp
@@ -40,7 +40,6 @@ namespace gnash {
 namespace {
     as_value function_apply(const fn_call& fn);
     as_value function_call(const fn_call& fn);
-    as_object* getFunctionPrototype();
     as_value function_ctor(const fn_call& fn);
 }
 
@@ -66,12 +65,6 @@ as_function::as_function(Global_as& gl)
        :
        as_object(gl)
 {
-#if 1
-       int flags = PropFlags::dontDelete |
-                   PropFlags::dontEnum | 
-                   PropFlags::onlySWF6Up;
-       init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype()), 
flags);
-#endif
 }
 
 std::string
@@ -167,50 +160,32 @@ registerFunctionNative(as_object& global)
 }
 
 void
-function_class_init(as_object& global, const ObjectURI& uri)
+function_class_init(as_object& where, const ObjectURI& uri)
 {
-    Global_as& gl = *VM::get().getGlobal();
+    Global_as& gl = getGlobal(where);
+
     NativeFunction* func = new NativeFunction(gl, function_ctor);
-    as_object* proto = getFunctionPrototype();
+    as_object* proto = createObject(gl);
 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
     func->init_member(NSV::PROP_CONSTRUCTOR, func);
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
 
        // Register _global.Function, only visible for SWF6 up
-       int swf6flags = PropFlags::dontEnum | 
-                    PropFlags::dontDelete | 
-                    PropFlags::onlySWF6Up;
-       global.init_member(uri, func, swf6flags);
+       const int swf6flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
+       func->init_member(NSV::PROP_uuPROTOuu, proto, swf6flags);
+       where.init_member(uri, func, swf6flags);
+    
+    VM& vm = getVM(where);
+
+    // Note: these are the first functions created, and they need the
+    // Function class to be registered.
+    proto->init_member("call", vm.getNative(101, 10), swf6flags);
+    proto->init_member("apply", vm.getNative(101, 11), swf6flags);
 }
 
 namespace {
 
-as_object*
-getFunctionPrototype()
-{
-
-       static boost::intrusive_ptr<as_object> proto;
-
-       if (proto.get() == NULL) {
-
-               // Initialize Function prototype
-        proto = createObject(*VM::get().getGlobal());
-        
-        VM& vm = VM::get();
-
-               vm.addStatic(proto.get());
-
-               const int flags = as_object::DefaultFlags | 
PropFlags::onlySWF6Up; 
-
-               proto->init_member("call", vm.getNative(101, 10), flags);
-               proto->init_member("apply", vm.getNative(101, 11), flags);
-       }
-
-       return proto.get();
-
-}
-
 as_value
 function_ctor(const fn_call& /*fn*/)
 {
diff --git a/testsuite/actionscript.all/Function.as 
b/testsuite/actionscript.all/Function.as
index ddadf71..91c826a 100644
--- a/testsuite/actionscript.all/Function.as
+++ b/testsuite/actionscript.all/Function.as
@@ -1047,7 +1047,7 @@ _global.Function = 8;
 f = ASnative(1, 0);
 check_equals(typeof(f), "function");
 f.hasOwnProperty = Object.prototype.hasOwnProperty;
-xcheck(!f.hasOwnProperty("__proto__"));
+check(!f.hasOwnProperty("__proto__"));
 check(!f.hasOwnProperty("constructor"));
 
 
@@ -1057,7 +1057,7 @@ _global.Function = {};
 f = ASnative(1, 0);
 check_equals(typeof(f), "function");
 f.hasOwnProperty = Object.prototype.hasOwnProperty;
-xcheck(!f.hasOwnProperty("__proto__"));
+check(!f.hasOwnProperty("__proto__"));
 check(!f.hasOwnProperty("constructor"));
 
 called = 0;

http://git.savannah.gnu.org/cgit//commit/?id=7798e1fcf93403bdec633d6bf18a401c54ba556b


commit 7798e1fcf93403bdec633d6bf18a401c54ba556b
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 12:14:50 2010 +0200

    Drop static entirely.

diff --git a/libcore/as_function.cpp b/libcore/as_function.cpp
index 7866c43..6c58494 100644
--- a/libcore/as_function.cpp
+++ b/libcore/as_function.cpp
@@ -80,25 +80,6 @@ as_function::stringValue() const
     return "[type Function]";
 }
 
-
-NativeFunction*
-as_function::getFunctionConstructor()
-{
-       static NativeFunction* func = 0;
-       if ( ! func )
-       {
-        Global_as& gl = *VM::get().getGlobal();
-               func = new NativeFunction(gl, function_ctor);
-        as_object* proto = getFunctionPrototype();
-
-        func->init_member(NSV::PROP_PROTOTYPE, proto);
-        func->init_member(NSV::PROP_CONSTRUCTOR, func);
-               proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
-               VM::get().addStatic(func);
-       }
-       return func;
-}
-
 as_object*
 constructInstance(as_function& ctor, const as_environment& env,
         fn_call::Args& args)
@@ -188,7 +169,13 @@ registerFunctionNative(as_object& global)
 void
 function_class_init(as_object& global, const ObjectURI& uri)
 {
-    NativeFunction* func = as_function::getFunctionConstructor();
+    Global_as& gl = *VM::get().getGlobal();
+    NativeFunction* func = new NativeFunction(gl, function_ctor);
+    as_object* proto = getFunctionPrototype();
+
+    func->init_member(NSV::PROP_PROTOTYPE, proto);
+    func->init_member(NSV::PROP_CONSTRUCTOR, func);
+    proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
 
        // Register _global.Function, only visible for SWF6 up
        int swf6flags = PropFlags::dontEnum | 
@@ -210,11 +197,6 @@ getFunctionPrototype()
                // Initialize Function prototype
         proto = createObject(*VM::get().getGlobal());
         
-               // We initialize the __proto__ member separately, as 
getObjectInterface
-               // will end up calling getFunctionPrototype again and we want 
that
-               // call to return the still-not-completely-constructed 
prototype rather
-               // then create a new one. 
-
         VM& vm = VM::get();
 
                vm.addStatic(proto.get());
diff --git a/libcore/as_function.h b/libcore/as_function.h
index 272190a..6d1ff37 100644
--- a/libcore/as_function.h
+++ b/libcore/as_function.h
@@ -101,9 +101,6 @@ public:
        /// Return true if this is a built-in class.
        virtual bool isBuiltin() { return false; }
 
-       /// Return the built-in Function constructor
-       static NativeFunction* getFunctionConstructor();
-
 protected:
        
     /// Construct a function with no interface
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 69c55a7..48277e1 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -359,9 +359,12 @@ VM::getNative(unsigned int x, unsigned int y) const
 
     as_function* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
     if (func) {
-        f->init_member(NSV::PROP_CONSTRUCTOR, func);
+        const int flags = PropFlags::dontDelete |
+                    PropFlags::dontEnum | 
+                    PropFlags::onlySWF6Up;
         f->init_member(NSV::PROP_uuPROTOuu, getMember(*func,
-                    NSV::PROP_PROTOTYPE));
+                    NSV::PROP_PROTOTYPE), flags);
+        f->init_member(NSV::PROP_CONSTRUCTOR, func);
     }
     return f;
 }

http://git.savannah.gnu.org/cgit//commit/?id=cd93b0126a7c7cef7ea3fecb5f6f642cbca5ca5f


commit cd93b0126a7c7cef7ea3fecb5f6f642cbca5ca5f
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:56:29 2010 +0200

    Remove 2 more static usages.

diff --git a/libcore/as_function.cpp b/libcore/as_function.cpp
index 5db84ba..7866c43 100644
--- a/libcore/as_function.cpp
+++ b/libcore/as_function.cpp
@@ -66,10 +66,12 @@ as_function::as_function(Global_as& gl)
        :
        as_object(gl)
 {
+#if 1
        int flags = PropFlags::dontDelete |
                    PropFlags::dontEnum | 
                    PropFlags::onlySWF6Up;
        init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype()), 
flags);
+#endif
 }
 
 std::string
diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index 4604fb0..32fdc57 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -164,8 +164,16 @@ Global_as::createFunction(Global_as::ASFunction function)
     proto->init_member(NSV::PROP_CONSTRUCTOR, f); 
     
     f->init_member(NSV::PROP_PROTOTYPE, proto);
-    f->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
+
+    as_function* fun =
+        gnash::getOwnProperty(*this, NSV::CLASS_FUNCTION).to_function();
+    if (fun) {
+        const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
+        f->set_member(NSV::PROP_uuPROTOuu, getMember(*fun,
+                    NSV::PROP_PROTOTYPE));
+        f->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        f->init_member(NSV::PROP_CONSTRUCTOR, fun);
+    }
     return f;
 }
 
@@ -178,8 +186,16 @@ Global_as::createClass(Global_as::ASFunction ctor, 
as_object* prototype)
         prototype->init_member(NSV::PROP_CONSTRUCTOR, cl); 
         cl->init_member(NSV::PROP_PROTOTYPE, prototype);
     }
-    cl->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
+    as_function* fun = 
+        gnash::getOwnProperty(*this, NSV::CLASS_FUNCTION).to_function();
+
+    if (fun) {
+        const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
+        cl->set_member(NSV::PROP_uuPROTOuu, getMember(*fun,
+                    NSV::PROP_PROTOTYPE));
+        cl->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        cl->init_member(NSV::PROP_CONSTRUCTOR, fun);
+    }
     return cl;
 }
 

http://git.savannah.gnu.org/cgit//commit/?id=9e08637ddb180097b1bd7aece2626fac5f16e5f4


commit 9e08637ddb180097b1bd7aece2626fac5f16e5f4
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:51:04 2010 +0200

    Drop static use.

diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index bb51378..dfbc6a2 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -3287,8 +3287,6 @@ ActionDefineFunction2(ActionExec& thread)
     as_object* proto = createObject(getGlobal(env));
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
-       func->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
     
     Global_as& gl = getGlobal(env);
     
@@ -3298,6 +3296,7 @@ ActionDefineFunction2(ActionExec& thread)
         func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
                     NSV::PROP_PROTOTYPE));
         func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        func->init_member(NSV::PROP_CONSTRUCTOR, f);
     }
 
     size_t i = thread.getCurrentPC() + 3; // skip tag id and length
@@ -3531,6 +3530,7 @@ ActionDefineFunction(ActionExec& thread)
         func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
                     NSV::PROP_PROTOTYPE));
         func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+        func->init_member(NSV::PROP_CONSTRUCTOR, f);
     }
 
     size_t i = thread.getCurrentPC() + 3;

http://git.savannah.gnu.org/cgit//commit/?id=693b64384cff5d688933ef95c3aeb9f7b5a2de3d


commit 693b64384cff5d688933ef95c3aeb9f7b5a2de3d
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:47:55 2010 +0200

    More passes.

diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index 487a709..bb51378 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -3282,13 +3282,23 @@ ActionDefineFunction2(ActionExec& thread)
     // of the function body.
     Function2* func = new Function2(code, env, thread.getNextPC(),
             thread.getScopeStack());
-
+    
     // We're stuck initializing our own prototype at the moment.
     as_object* proto = createObject(getGlobal(env));
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
        func->init_member(NSV::PROP_CONSTRUCTOR,
             as_function::getFunctionConstructor());
+    
+    Global_as& gl = getGlobal(env);
+    
+    as_function* f = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
+    if (f) {
+        const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
+        func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
+                    NSV::PROP_PROTOTYPE));
+        func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+    }
 
     size_t i = thread.getCurrentPC() + 3; // skip tag id and length
 
@@ -3512,8 +3522,16 @@ ActionDefineFunction(ActionExec& thread)
     as_object* proto = createObject(getGlobal(env));
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
-       func->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
+    
+    Global_as& gl = getGlobal(env);
+    
+    as_function* f = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
+    if (f) {
+        const int flags = as_object::DefaultFlags | PropFlags::onlySWF6Up;
+        func->set_member(NSV::PROP_uuPROTOuu, getMember(*f,
+                    NSV::PROP_PROTOTYPE));
+        func->set_member_flags(NSV::PROP_uuPROTOuu, flags);
+    }
 
     size_t i = thread.getCurrentPC() + 3;
 
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 634048e..69c55a7 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -357,7 +357,7 @@ VM::getNative(unsigned int x, unsigned int y) const
     
     Global_as& gl = *_global;
 
-    as_object* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_object(gl);
+    as_function* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_function();
     if (func) {
         f->init_member(NSV::PROP_CONSTRUCTOR, func);
         f->init_member(NSV::PROP_uuPROTOuu, getMember(*func,
diff --git a/testsuite/actionscript.all/Function.as 
b/testsuite/actionscript.all/Function.as
index f7f0240..ddadf71 100644
--- a/testsuite/actionscript.all/Function.as
+++ b/testsuite/actionscript.all/Function.as
@@ -1035,8 +1035,8 @@ check(f.constructor !== 
_global.Function.prototype.constructor);
 // SWF-defined functions:
 // __proto__ is _global.Function.prototype
 uf = function() {};
-xcheck(uf.p === "hi");
-xcheck(uf.__proto__ === _global.Function.prototype);
+check(uf.p === "hi");
+check(uf.__proto__ === _global.Function.prototype);
 
 // uf.prototype is a new object.
 check(uf.prototype.constructor === uf);
@@ -1048,7 +1048,7 @@ f = ASnative(1, 0);
 check_equals(typeof(f), "function");
 f.hasOwnProperty = Object.prototype.hasOwnProperty;
 xcheck(!f.hasOwnProperty("__proto__"));
-xcheck(!f.hasOwnProperty("constructor"));
+check(!f.hasOwnProperty("constructor"));
 
 
 _global.Function = {};
@@ -1058,7 +1058,7 @@ f = ASnative(1, 0);
 check_equals(typeof(f), "function");
 f.hasOwnProperty = Object.prototype.hasOwnProperty;
 xcheck(!f.hasOwnProperty("__proto__"));
-xcheck(!f.hasOwnProperty("constructor"));
+check(!f.hasOwnProperty("constructor"));
 
 called = 0;
 _global.Function = function() { ++called; };

http://git.savannah.gnu.org/cgit//commit/?id=a6d690e2243f2f1f42bc9efec59d5bb3392e300b


commit a6d690e2243f2f1f42bc9efec59d5bb3392e300b
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:28:51 2010 +0200

    Init correct member: another pass.

diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 271a056..634048e 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -359,8 +359,7 @@ VM::getNative(unsigned int x, unsigned int y) const
 
     as_object* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_object(gl);
     if (func) {
-        f->init_member(NSV::PROP_CONSTRUCTOR, getMember(*func,
-                    NSV::PROP_CONSTRUCTOR));
+        f->init_member(NSV::PROP_CONSTRUCTOR, func);
         f->init_member(NSV::PROP_uuPROTOuu, getMember(*func,
                     NSV::PROP_PROTOTYPE));
     }
diff --git a/testsuite/actionscript.all/Function.as 
b/testsuite/actionscript.all/Function.as
index 9026238..f7f0240 100644
--- a/testsuite/actionscript.all/Function.as
+++ b/testsuite/actionscript.all/Function.as
@@ -1028,7 +1028,7 @@ check(f.__proto__  === o);
 // Inherited property.
 check(f.p === "hi");
 check(f instanceOf _global.Function);
-xcheck(f.constructor === _global.Function);
+check(f.constructor === _global.Function);
 check(f.constructor !== _global.Function.prototype.constructor);
 
 

http://git.savannah.gnu.org/cgit//commit/?id=f316478988eab5ed46f2c54c412f13bd3e828682


commit f316478988eab5ed46f2c54c412f13bd3e828682
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:25:41 2010 +0200

    Disregard visibility, testsuite passes.

diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 0538979..271a056 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -357,10 +357,12 @@ VM::getNative(unsigned int x, unsigned int y) const
     
     Global_as& gl = *_global;
 
-    as_object* func = getMember(gl, NSV::CLASS_FUNCTION).to_object(gl);
+    as_object* func = getOwnProperty(gl, NSV::CLASS_FUNCTION).to_object(gl);
     if (func) {
         f->init_member(NSV::PROP_CONSTRUCTOR, getMember(*func,
                     NSV::PROP_CONSTRUCTOR));
+        f->init_member(NSV::PROP_uuPROTOuu, getMember(*func,
+                    NSV::PROP_PROTOTYPE));
     }
     return f;
 }
diff --git a/testsuite/actionscript.all/Function.as 
b/testsuite/actionscript.all/Function.as
index 054c932..9026238 100644
--- a/testsuite/actionscript.all/Function.as
+++ b/testsuite/actionscript.all/Function.as
@@ -1000,8 +1000,8 @@ check(f.__proto__ === backup);
 
 // Native function __proto__ is _global.Function.prototype
 f = ASnative(1, 0);
-xcheck(f.__proto__ === _global.Function.prototype);
-xcheck(f.__proto__ === 8);
+check(f.__proto__ === _global.Function.prototype);
+check(f.__proto__ === 8);
 
 funbackup = _global.Function;
 
@@ -1023,11 +1023,11 @@ _global.Function.constructor = 6;
 //    regardless of visibility.
 
 f = ASnative(1, 0);
-xcheck(f.__proto__  === o);
+check(f.__proto__  === o);
 
 // Inherited property.
-xcheck(f.p === "hi");
-xcheck(f instanceOf _global.Function);
+check(f.p === "hi");
+check(f instanceOf _global.Function);
 xcheck(f.constructor === _global.Function);
 check(f.constructor !== _global.Function.prototype.constructor);
 

http://git.savannah.gnu.org/cgit//commit/?id=3c624d76aa4bd9ace680aab8dc78f1a08235b6f2


commit 3c624d76aa4bd9ace680aab8dc78f1a08235b6f2
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 11:07:24 2010 +0200

    Add Global_as.cpp, improve some native function cases.

diff --git a/libcore/as_function.cpp b/libcore/as_function.cpp
index 75e6dd3..5db84ba 100644
--- a/libcore/as_function.cpp
+++ b/libcore/as_function.cpp
@@ -307,7 +307,7 @@ function_apply(const fn_call& fn)
 
     return rv;
 }
-
+    
 as_value
 function_call(const fn_call& fn)
 {
diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
new file mode 100644
index 0000000..4604fb0
--- /dev/null
+++ b/libcore/asobj/Global_as.cpp
@@ -0,0 +1,1276 @@
+// Global.cpp:  Global ActionScript class setup, for Gnash.
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+//   Foundation, Inc
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "as_object.h"
+#include "movie_root.h"
+#include "PropFlags.h"
+#include "as_value.h"
+#include "as_function.h" // for function_class_init
+#include "NativeFunction.h" 
+#include "AsBroadcaster.h"
+#include "Boolean_as.h"
+#include "Color_as.h"
+#include "CustomActions.h"
+#include "Date_as.h" 
+#include "Array_as.h" 
+#include "Error_as.h"
+#include "String_as.h"
+#include "Selection_as.h"
+#include "Number_as.h"
+#include "Math_as.h"
+#include "Accessibility_as.h"
+#include "ContextMenu_as.h"
+#include "ContextMenuItem_as.h"
+#include "Key_as.h"
+#include "Mouse_as.h"
+#include "Microphone_as.h"
+#include "Sound_as.h"
+#include "Camera_as.h"
+#include "Stage_as.h"
+#include "MovieClip_as.h"
+#include "flash/display/BitmapData_as.h"
+#include "flash/filters/BitmapFilter_as.h"
+#include "flash/geom/ColorTransform_as.h"
+#include "LocalConnection_as.h"
+#include "XMLSocket_as.h"
+#include "SharedObject_as.h"
+#include "NetConnection_as.h"
+#include "NetStream_as.h"
+#include "System_as.h"
+#include "TextSnapshot_as.h"
+#include "TextField_as.h"
+#include "TextFormat_as.h"
+#include "flash/text/TextRenderer_as.h"
+#include "XML_as.h"
+#include "XMLNode_as.h"
+#include "flash/external/ExternalInterface_as.h"
+#include "MovieClipLoader.h"
+#include "movie_definition.h"
+#include "Video.h"
+#include "extension.h"
+#include "VM.h"
+#include "Timers.h"
+#include "URL.h" 
+#include "builtin_function.h"
+#include "rc.h"
+#include "ClassHierarchy.h"
+#include "namedStrings.h"
+#include "GnashNumeric.h" // for isfinite replacement
+#include "flash_pkg.h"
+#include "fn_call.h"
+#include "Button.h"
+#include "LoadVars_as.h"
+#include "Object.h"
+#include "LoadableObject.h"
+
+#include <map>
+#include <limits> 
+#include <sstream>
+#include <boost/lexical_cast.hpp>
+#include <boost/assign/list_of.hpp>
+
+// Common code to warn and return if a required single arg is not present
+// and to warn if there are extra args.
+#define ASSERT_FN_ARGS_IS_1                        \
+    if (fn.nargs < 1) {                            \
+    IF_VERBOSE_ASCODING_ERRORS(                    \
+            log_aserror(_("%s needs one argument"), __FUNCTION__);        \
+            )                                \
+         return as_value();                            \
+    }                                    \
+    IF_VERBOSE_ASCODING_ERRORS(                        \
+    if (fn.nargs > 1)                        \
+            log_aserror(_("%s has more than one argument"), __FUNCTION__);    \
+    )
+
+namespace gnash {
+
+namespace {
+
+    const ClassHierarchy::NativeClasses& avm1Classes();
+
+    as_value global_trace(const fn_call& fn);
+    as_value global_isNaN(const fn_call& fn);
+    as_value global_isfinite(const fn_call& fn);
+    as_value global_unescape(const fn_call& fn);
+    as_value global_escape(const fn_call& fn);
+    as_value global_parsefloat(const fn_call& fn);
+    as_value global_parseint(const fn_call& fn);
+    as_value global_assetpropflags(const fn_call& fn);
+    as_value global_assetuperror(const fn_call& fn);
+    as_value global_asnative(const fn_call& fn);
+    as_value global_asnew(const fn_call& fn);
+    as_value global_assetnative(const fn_call& fn);
+    as_value global_assetnativeaccessor(const fn_call& fn);
+    as_value global_asconstructor(const fn_call& fn);
+    as_value global_updateAfterEvent(const fn_call& fn);
+    as_value global_setTimeout(const fn_call& fn);
+    as_value global_clearInterval(const fn_call& fn);
+    as_value global_setInterval(const fn_call& fn);
+    
+    // These are present in the standalone, not sure about the plugin.
+    as_value global_enableDebugConsole(const fn_call& fn);
+    as_value global_showRedrawRegions(const fn_call& fn);
+
+    // This is a help function for the silly AsSetupError function.
+    as_value local_errorConstructor(const fn_call& fn);
+    
+    void registerNatives(as_object& global);
+    template<typename T> as_object* constructObject(Global_as& gl, const T& 
arg,
+            string_table::key className);
+}
+
+Global_as::Global_as(VM& vm)
+    :
+    as_object(vm),
+    _et(new Extension()),
+    _classes(this, _et.get()),
+    _objectProto(new as_object(*this))
+{
+}
+       
+Global_as::~Global_as()
+{
+}
+
+builtin_function*
+Global_as::createFunction(Global_as::ASFunction function)
+{
+    as_object* proto = createObject(*this);
+    builtin_function* f = new builtin_function(*this, function);
+    
+    proto->init_member(NSV::PROP_CONSTRUCTOR, f); 
+    
+    f->init_member(NSV::PROP_PROTOTYPE, proto);
+    f->init_member(NSV::PROP_CONSTRUCTOR,
+            as_function::getFunctionConstructor());
+    return f;
+}
+
+as_object*
+Global_as::createClass(Global_as::ASFunction ctor, as_object* prototype)
+{
+    as_object* cl = new builtin_function(*this, ctor);
+    
+    if (prototype) {
+        prototype->init_member(NSV::PROP_CONSTRUCTOR, cl); 
+        cl->init_member(NSV::PROP_PROTOTYPE, prototype);
+    }
+    cl->init_member(NSV::PROP_CONSTRUCTOR,
+            as_function::getFunctionConstructor());
+    return cl;
+}
+
+as_object*
+Global_as::createString(const std::string& s)
+{
+    // This is not really correct. If there is no String class, to_object()
+    // returns an undefined value, not a null object. The behaviour is the
+    // same for versions 5 to 8.
+    return constructObject(*this, s, NSV::CLASS_STRING);
+}
+
+as_object*
+Global_as::createNumber(double d)
+{
+    // This is not really correct. If there is no String class, to_object()
+    // returns an undefined value, not a null object. The behaviour is the
+    // same for versions 5 to 8.
+    return constructObject(*this, d, NSV::CLASS_NUMBER);
+
+}
+
+/// Construct an Array.
+//
+/// This uses the _global Array class to initialize the "constructor" and
+/// "__proto__" properties. If Array.prototype is undefined, those properties
+/// are not added.
+as_object*
+Global_as::createArray()
+{
+    as_object* array = new as_object(*this);
+
+    as_value ctor = getMember(*this, NSV::CLASS_ARRAY);
+    as_object* obj = ctor.to_object(*this);
+    if (obj) {
+        as_value proto;
+        if (obj->get_member(NSV::PROP_PROTOTYPE, &proto)) {
+            array->init_member(NSV::PROP_CONSTRUCTOR, ctor);
+            array->set_prototype(getMember(*obj, NSV::PROP_PROTOTYPE));
+        }
+    }
+
+    array->init_member(NSV::PROP_LENGTH, 0.0);
+    array->setArray();
+    return array;
+}
+
+as_object*
+Global_as::createBoolean(bool b)
+{
+    return constructObject(*this, b, NSV::CLASS_BOOLEAN);
+}
+
+void 
+Global_as::markReachableResources() const
+{
+    _classes.markReachableResources();
+    _objectProto->setReachable();
+    as_object::markReachableResources();
+}
+
+void
+Global_as::registerClasses()
+{
+    registerNatives(*this);
+
+    function_class_init(*this, NSV::CLASS_FUNCTION);
+    initObjectClass(_objectProto, *this, NSV::CLASS_OBJECT); 
+
+    string_class_init(*this, NSV::CLASS_STRING); 
+    array_class_init(*this, NSV::CLASS_ARRAY); 
+
+    // No idea why, but it seems there's a NULL _global.o 
+    // defined at player startup...
+    // Probably due to the AS-based initialization 
+    // Not enumerable but overridable and deletable.
+    //
+    as_value nullVal; nullVal.set_null();
+    init_member("o", nullVal, PropFlags::dontEnum);
+
+
+    VM& vm = getVM();
+
+    // _global functions.            
+    // These functions are only available in SWF6+, but this is just
+    // because SWF5 or lower did not have a "_global"
+    // reference at all.
+    init_member("ASnative", createFunction(global_asnative));
+    init_member("ASconstructor", createFunction(global_asconstructor));
+    init_member("ASSetPropFlags", vm.getNative(1, 0));
+    init_member("ASSetNative", vm.getNative(4, 0));
+    init_member("ASSetNativeAccessor", vm.getNative(4, 1));
+    init_member("AsSetupError", createFunction(global_assetuperror));
+    init_member("updateAfterEvent", vm.getNative(9, 0));
+    init_member("trace", vm.getNative(100, 4));
+
+    init_member("setInterval", vm.getNative(250, 0));
+    init_member("clearInterval", vm.getNative(250, 1));
+    init_member("setTimeout", vm.getNative(250, 2));
+ 
+    // This is an odd function with no properties. There ought to be
+    // a better way of implementing this. See also TextFormat.getTextExtent.
+    as_function* edc = createFunction(global_enableDebugConsole);
+    edc->clearProperties();
+    init_member("enableDebugConsole", edc);
+    init_member("showRedrawRegions", vm.getNative(1021, 1));
+    
+    string_table& st = getStringTable(*this);
+    init_member("clearTimeout", getMember(*this, st.find("clearInterval")));
+
+    _classes.declareAll(avm1Classes());
+
+    // SWF8 visibility:
+    const string_table::key NS_FLASH = st.find("flash");
+    flash_package_init(*this, NS_FLASH); 
+
+    const int version = vm.getSWFVersion();
+
+    switch (version)
+    {
+        default:
+            // Version 10 or above reported
+        case 9:
+        case 8:
+
+        case 7:
+        case 6:
+
+        case 5:
+        
+            // This is surely not correct, but they are not available
+            // in SWF4
+            init_member("escape", vm.getNative(100, 0));
+            init_member("unescape", vm.getNative(100, 1));
+            init_member("parseInt", vm.getNative(100, 2));
+            init_member("parseFloat", vm.getNative(100, 3));
+            init_member("isNaN", vm.getNative(200, 18));
+            init_member("isFinite", vm.getNative(200, 19));
+
+            init_member("NaN", as_value(NaN));
+            init_member("Infinity", as_value(
+                        std::numeric_limits<double>::infinity()));
+        
+        case 4:
+        case 3:
+        case 2:
+        case 1:
+            break;
+    }
+
+    loadExtensions();
+}
+
+as_object*
+createObject(const Global_as& gl)
+{
+    as_object* obj = new as_object(gl);
+    gl.makeObject(*obj);
+    return obj;
+}
+
+//-----------------------
+// Extensions
+//-----------------------
+// Scan the plugin directories for all plugins, and load them now.
+// FIXME: this should actually be done dynamically, and only
+// if a plugin defines a class that a movie actually wants to
+// use.
+void
+Global_as::loadExtensions()
+{
+
+    if (RcInitFile::getDefaultInstance().enableExtensions()) {
+        log_security(_("Extensions enabled, scanning plugin dir for load"));
+        _et->scanAndLoad(*this);
+    }
+    else {
+        log_security(_("Extensions disabled"));
+    }
+
+}
+
+void
+Global_as::makeObject(as_object& o) const
+{
+    o.set_prototype(_objectProto);
+}
+
+namespace {
+
+const ClassHierarchy::NativeClasses&
+avm1Classes()
+{
+
+    typedef ClassHierarchy::NativeClass N;
+
+    // Since we maintain separate lists for AVM1 and AVM2, these are all
+    // considered to be in the 'Global' namespace (AVM1 has no namespaces)
+    // An ObjectURI constructed without a namespace is in the global namespace.
+    static const ClassHierarchy::NativeClasses s = boost::assign::list_of
+
+        (N(system_class_init, NSV::CLASS_SYSTEM, 1))
+        (N(stage_class_init, NSV::CLASS_STAGE, 1))
+        (N(movieclip_class_init, NSV::CLASS_MOVIE_CLIP, 3))
+        (N(textfield_class_init, NSV::CLASS_TEXT_FIELD, 3))
+        (N(math_class_init, NSV::CLASS_MATH, 4))
+        (N(boolean_class_init, NSV::CLASS_BOOLEAN, 5))
+        (N(button_class_init, NSV::CLASS_BUTTON, 5))
+        (N(color_class_init, NSV::CLASS_COLOR, 5))
+        (N(selection_class_init, NSV::CLASS_SELECTION, 5))
+        (N(sound_class_init, NSV::CLASS_SOUND, 5))
+        (N(xmlsocket_class_init, NSV::CLASS_XMLSOCKET, 5))
+        (N(date_class_init, NSV::CLASS_DATE, 5))
+        (N(xmlnode_class_init, NSV::CLASS_XMLNODE, 5))
+        (N(xml_class_init, NSV::CLASS_XML, 5))
+        (N(mouse_class_init, NSV::CLASS_MOUSE, 5))
+        (N(number_class_init, NSV::CLASS_NUMBER, 5))
+        (N(textformat_class_init, NSV::CLASS_TEXT_FORMAT, 5))
+        (N(key_class_init, NSV::CLASS_KEY, 5))
+        (N(AsBroadcaster::init, NSV::CLASS_AS_BROADCASTER, 5))
+        (N(textsnapshot_class_init, NSV::CLASS_TEXT_SNAPSHOT, 5))
+        (N(video_class_init, NSV::CLASS_VIDEO, 6))
+        (N(camera_class_init, NSV::CLASS_CAMERA, 5))
+        (N(microphone_class_init, NSV::CLASS_MICROPHONE, 5))
+        (N(sharedobject_class_init, NSV::CLASS_SHARED_OBJECT, 5))
+        (N(loadvars_class_init, NSV::CLASS_LOAD_VARS, 5))
+        (N(localconnection_class_init, NSV::CLASS_LOCALCONNECTION, 6))
+        (N(customactions_class_init, NSV::CLASS_CUSTOM_ACTIONS, 6))
+        (N(netconnection_class_init, NSV::CLASS_NET_CONNECTION, 6))
+        (N(netstream_class_init, NSV::CLASS_NET_STREAM, 6))
+        (N(contextmenu_class_init, NSV::CLASS_CONTEXTMENU, 5))
+        (N(contextmenuitem_class_init, NSV::CLASS_CONTEXTMENUITEM, 5))
+        (N(moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER, 5))
+        (N(Error_class_init, NSV::CLASS_ERROR, 5))
+        (N(accessibility_class_init, NSV::CLASS_ACCESSIBILITY, 5));
+
+    return s;
+
+}
+
+as_value
+global_trace(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+
+    // Log our argument.
+    //
+    // @@ what if we get extra args?
+    //
+    // @@ Nothing needs special treatment,
+    //    as_value::to_string() will take care of everything
+    log_trace("%s", fn.arg(0).to_string());
+
+    return as_value();
+}
+
+
+as_value
+global_isNaN(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+
+    return as_value(static_cast<bool>(isNaN(fn.arg(0).to_number())));
+}
+
+
+as_value
+global_isfinite(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+
+    return as_value(static_cast<bool>(isFinite(fn.arg(0).to_number())));
+}
+
+/// \brief Encode a string to URL-encoded format
+/// converting all dodgy DisplayObjects to %AB hex sequences
+//
+/// Characters that need escaping are:
+/// - ASCII control DisplayObjects: 0-31 and 127
+/// - Non-ASCII chars: 128-255
+/// - URL syntax DisplayObjects: $ & + , / : ; = ? @
+/// - Unsafe DisplayObjects: SPACE " < > # % { } | \ ^ ~ [ ] `
+/// Encoding is a % followed by two hexadecimal DisplayObjects, case 
insensitive.
+/// See RFC1738 http://www.rfc-editor.org/rfc/rfc1738.txt,
+/// Section 2.2 "URL Character Encoding Issues"
+as_value
+global_escape(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+
+    std::string input = fn.arg(0).to_string();
+    URL::encode(input);
+    return as_value(input);
+}
+
+/// \brief Decode a string from URL-encoded format
+/// converting all hexadecimal sequences to ASCII DisplayObjects.
+//
+/// A sequence to convert is % followed by two case-independent hexadecimal
+/// digits, which is replaced by the equivalent ASCII DisplayObject.
+/// See RFC1738 http://www.rfc-editor.org/rfc/rfc1738.txt,
+/// Section 2.2 "URL Character Encoding Issues"
+as_value
+global_unescape(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+
+    std::string input = fn.arg(0).to_string();
+    URL::decode(input);
+    return as_value(input);
+}
+
+// parseFloat (string)
+as_value
+global_parsefloat(const fn_call& fn)
+{
+    ASSERT_FN_ARGS_IS_1
+    
+    std::istringstream s(fn.arg(0).to_string());
+    double result;
+    
+    if (!(s >> result)) {
+        return as_value(NaN);   
+    }    
+
+    return as_value(result);
+}
+
+// parseInt(string[, base])
+// The second argument, if supplied, is the base.
+// If none is supplied, we have to work out the 
+// base from the string. Decimal, octal and hexadecimal are
+// possible, according to the following rules:
+// 1. If the string starts with 0x or 0X, the number is hex.
+// 2. The 0x or 0X may be *followed* by '-' or '+' to indicate sign. A number
+//    with no sign is positive.
+// 3. If the string starts with 0, -0 or +0 and contains only the 
DisplayObjects
+//    0-7.
+// 4. If the string starts with *any* other sequence of DisplayObjects, 
including
+//    whitespace, it is decimal.
+as_value
+global_parseint(const fn_call& fn)
+{
+    if (!fn.nargs) {
+        IF_VERBOSE_ASCODING_ERRORS(
+            log_aserror(_("%s needs at least one argument"), __FUNCTION__);
+        )
+        return as_value();
+    }
+
+    IF_VERBOSE_ASCODING_ERRORS(
+        if (fn.nargs > 2) {
+            log_aserror(_("%s has more than two arguments"), __FUNCTION__);
+        }
+    )
+
+    const std::string& expr = fn.arg(0).to_string();
+
+    // A second argument specifies the base.
+    // Parsing still starts after any positive/negative 
+    // sign or hex identifier (parseInt("0x123", 8) gives
+    // 83, not 0; parseInt(" 0x123", 8) is 0), which is
+    // why we do this here.
+    size_t base;
+    if (fn.nargs > 1)
+    {
+        base = toInt(fn.arg(1));
+    
+        // Bases from 2 to 36 are valid, otherwise return NaN
+        if (base < 2 || base > 36) return as_value(NaN);
+    }
+    else
+    {
+        /// No radix specified, so try parsing as octal or hexadecimal
+        try {
+            double d;
+            if (parseNonDecimalInt(expr, d, false)) return d;
+        }
+        catch (boost::bad_lexical_cast&) {
+            return as_value(NaN);
+        }
+
+        /// The number is not hex or octal, so we'll assume it's base-10.
+        base = 10;
+
+    }
+
+    std::string::const_iterator it = expr.begin();
+
+    // Check for expectional case "-0x" or "+0x", which
+    // return NaN
+    if ((expr.length() > 2) && (*it == '-' || *it == '+') &&
+            *(it + 1) == '0' && std::toupper(*(it + 2)) == 'X') {
+        return as_value(NaN);
+    }
+    
+    // Try hexadecimal first
+    if (expr.substr(0, 2) == "0x" || expr.substr(0, 2) == "0X") it += 2;
+    else {
+        // Skip leading whitespace
+        while(*it == ' ' || *it == '\n' || *it == '\t' || *it == '\r') {
+            ++it;
+        }
+        if (it == expr.end()) return as_value(NaN);
+    }    
+
+    bool negative = false;
+    if (*it == '-' || *it == '+')
+    {
+        if (*it == '-') negative = true;
+        
+        it++;
+        if (it == expr.end()) return as_value(NaN);
+    }
+    
+    // Now we have the base, parse the digits. The iterator should
+    // be pointing at the first digit.
+    
+    const std::string digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+    // Check to see if the first digit is valid, otherwise 
+    // return NaN.
+    std::string::size_type digit = digits.find(toupper(*it));
+
+    if (digit >= base || digit == std::string::npos) return as_value(NaN);
+
+    // The first digit was valid, so continue from the present position
+    // until we reach the end of the string or an invalid DisplayObject,
+    // adding valid DisplayObjects to our result.
+    // Which DisplayObjects are invalid depends on the base. 
+    double result = digit;
+    ++it;
+    
+    while (it != expr.end() && (digit = digits.find(toupper(*it))) < base
+            && digit != std::string::npos) {
+        result = result * base + digit;
+        ++it;
+    }
+
+    // Now return the parsed string as an integer.
+    return negative ? as_value(-result) : as_value(result);
+}
+
+// ASSetPropFlags function
+as_value
+global_assetpropflags(const fn_call& fn)
+{
+
+    if (fn.nargs < 3) {
+        IF_VERBOSE_ASCODING_ERRORS(    
+            log_aserror(_("%s needs at least three arguments"), __FUNCTION__);
+        )
+        return as_value();
+    }
+    
+    IF_VERBOSE_ASCODING_ERRORS(
+        if (fn.nargs > 4) {
+            log_aserror(_("%s has more than four arguments"), 
"AsSetPropFlags");
+        }
+    );
+    
+    // object
+    boost::intrusive_ptr<as_object> obj = fn.arg(0).to_object(getGlobal(fn));
+    if ( ! obj ) {
+        IF_VERBOSE_ASCODING_ERRORS(
+        log_aserror(_("Invalid call to ASSetPropFlags: "
+            "first argument is not an object: %s"),
+            fn.arg(0));
+        );
+        return as_value();
+    }
+
+    // list of child names
+
+    const as_value& props = fn.arg(1);
+
+    const int flagsMask = PropFlags::dontEnum |
+                          PropFlags::dontDelete |
+                          PropFlags::readOnly |
+                          PropFlags::onlySWF6Up |
+                          PropFlags::ignoreSWF6 |
+                          PropFlags::onlySWF7Up |
+                          PropFlags::onlySWF8Up |
+                          PropFlags::onlySWF9Up;
+
+    // a number which represents three bitwise flags which
+    // are used to determine whether the list of child names should be hidden,
+    // un-hidden, protected from over-write, un-protected from over-write,
+    // protected from deletion and un-protected from deletion
+    const int setTrue = int(fn.arg(2).to_number()) & flagsMask;
+
+    // Is another integer bitmask that works like set_true,
+    // except it sets the attributes to false. The
+    // set_false bitmask is applied before set_true is applied
+
+    // ASSetPropFlags was exposed in Flash 5, however the fourth argument
+    // 'set_false' was not required as it always defaulted to the value '~0'. 
+    const int setFalse = (fn.nargs < 4 ? 0 : toInt(fn.arg(3))) &
+        flagsMask;
+
+    obj->setPropFlags(props, setFalse, setTrue);
+
+    return as_value();
+}
+
+// ASconstructor function
+// See: http://osflash.org/flashcoders/undocumented/asnative?s=asnative
+as_value
+global_asconstructor(const fn_call& fn)
+{
+
+    if (fn.nargs < 2) {
+        IF_VERBOSE_ASCODING_ERRORS(    
+            std::ostringstream ss; fn.dump_args(ss);
+            log_aserror(_("ASNative(%s): needs at least two arguments"),
+                ss.str());
+        )
+        return as_value();
+    }
+
+    const int sx = toInt(fn.arg(0));
+    const int sy = toInt(fn.arg(1));
+
+    if (sx < 0 || sy < 0) {
+        IF_VERBOSE_ASCODING_ERRORS(    
+            std::ostringstream ss; fn.dump_args(ss);
+            log_aserror(_("ASconstructor(%s): args must be 0 or above"),
+                ss.str());
+        )
+        return as_value();
+    }
+
+    const unsigned int x = static_cast<unsigned int>(sx);
+    const unsigned int y = static_cast<unsigned int>(sy);
+
+    VM& vm = getVM(fn);
+    as_function* fun = vm.getNative(x, y);
+    if (!fun) {
+        log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
+        return as_value();
+    }
+
+    Global_as& gl = getGlobal(fn);
+    fun->init_member(NSV::PROP_PROTOTYPE, createObject(gl));
+
+    return as_value(fun);
+        
+}
+
+// ASNative function
+// See: http://osflash.org/flashcoders/undocumented/asnative?s=asnative
+as_value
+global_asnative(const fn_call& fn)
+{
+
+    if (fn.nargs < 2)
+    {
+        IF_VERBOSE_ASCODING_ERRORS(    
+            std::ostringstream ss; fn.dump_args(ss);
+            log_aserror(_("ASNative(%s): needs at least two arguments"),
+                ss.str());
+        )
+        return as_value();
+    }
+
+    const int sx = toInt(fn.arg(0));
+    const int sy = toInt(fn.arg(1));
+
+    if (sx < 0 || sy < 0) {
+        IF_VERBOSE_ASCODING_ERRORS(    
+            std::ostringstream ss; fn.dump_args(ss);
+            log_aserror(_("ASnative(%s): args must be 0 or above"),
+                ss.str());
+        )
+        return as_value();
+    }
+
+    const unsigned int x = static_cast<unsigned int>(sx);
+    const unsigned int y = static_cast<unsigned int>(sy);
+
+    VM& vm = getVM(fn);
+    as_function* fun = vm.getNative(x, y);
+    if (!fun) {
+        log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
+        return as_value();
+    }
+    return as_value(fun);
+        
+}
+
+// Obsolete ASnew function (exists only as ASnative(2, 0))
+as_value
+global_asnew(const fn_call& /*fn*/)
+{
+    LOG_ONCE(log_unimpl("ASNative (2, 0) - old ASnew"));
+    return as_value();
+}
+
+
+/// ASSetNative(targetObject, major, properties, minor)
+//
+/// Sets a series of properties on targetObject using the native table.
+/// The third argument is generally documented to be an array, but in fact
+/// it is always converted to a string and parsed.
+as_value
+global_assetnative(const fn_call& fn)
+{
+
+    if (fn.nargs < 3) {
+        return as_value();
+    }
+
+    Global_as& gl = getGlobal(fn);
+
+    as_object* targetObject = fn.arg(0).to_object(gl);
+    if (!targetObject) {
+        return as_value();
+    }
+
+    const int major = toInt(fn.arg(1));
+    if (major < 0) return as_value();
+
+    const std::string& props = fn.arg(2).to_string();
+    const int minor =
+        fn.nargs > 3 ? std::max<boost::int32_t>(toInt(fn.arg(3)), 0) : 0;
+
+    std::string::const_iterator pos = props.begin();
+
+    VM& vm = getVM(fn);
+
+    size_t i = 0;
+
+    // pos is always the position after the last located property.
+    while (pos != props.end()) {
+
+        // If there are no further commas, find the end of the string.
+        std::string::const_iterator comma = std::find(pos, props.end(), ',');
+
+        const char num = *pos;
+        
+        int flag;
+
+        switch (num) {
+            case '6':
+                flag = PropFlags::onlySWF6Up;
+                ++pos;
+                break;
+            case '7':
+                flag = PropFlags::onlySWF7Up;
+                ++pos;
+                break;
+            case '8':
+                flag = PropFlags::onlySWF8Up;
+                ++pos;
+                break;
+            case '9':
+                flag = PropFlags::onlySWF9Up;
+                ++pos;
+                break;
+            default:
+                flag = 0;
+
+        }
+        const std::string& property = std::string(pos, comma);
+        if (!property.empty()) {
+            targetObject->init_member(property,
+                    vm.getNative(major, minor + i), flag);
+        }
+        if (comma == props.end()) break;
+        pos = comma + 1;
+        ++i;
+    }
+    return as_value();
+}
+
+// This is like ASSetNative, but attaches getter/setters.
+as_value
+global_assetnativeaccessor(const fn_call& fn)
+{
+    if (fn.nargs < 3) {
+        return as_value();
+    }
+
+    Global_as& gl = getGlobal(fn);
+
+    as_object* targetObject = fn.arg(0).to_object(gl);
+    if (!targetObject) {
+        return as_value();
+    }
+
+    const int major = toInt(fn.arg(1));
+    if (major < 0) return as_value();
+
+    const std::string& props = fn.arg(2).to_string();
+    const int minor =
+        fn.nargs > 3 ? std::max<boost::int32_t>(toInt(fn.arg(3)), 0) : 0;
+
+    std::string::const_iterator pos = props.begin();
+
+    VM& vm = getVM(fn);
+
+    size_t i = 0;
+
+    // pos is always the position after the last located property.
+    while (pos != props.end()) {
+
+        // If there are no further commas, find the end of the string.
+        std::string::const_iterator comma = std::find(pos, props.end(), ',');
+
+        const char num = *pos;
+        
+        int flag;
+
+        switch (num) {
+            case '6':
+                flag = PropFlags::onlySWF6Up;
+                ++pos;
+                break;
+            case '7':
+                flag = PropFlags::onlySWF7Up;
+                ++pos;
+                break;
+            case '8':
+                flag = PropFlags::onlySWF8Up;
+                ++pos;
+                break;
+            case '9':
+                flag = PropFlags::onlySWF9Up;
+                ++pos;
+                break;
+            default:
+                flag = 0;
+
+        }
+        const std::string& property = std::string(pos, comma);
+        if (!property.empty()) {
+            NativeFunction* getset = vm.getNative(major, minor + i);
+            targetObject->init_property(property, *getset, *getset, flag);
+        }
+        if (comma == props.end()) break;
+        pos = comma + 1;
+        ++i;
+    }
+    return as_value();
+    LOG_ONCE(log_unimpl("ASSetNativeAccessor"));
+    return as_value();
+}
+
+
+// updateAfterEvent function
+as_value
+global_updateAfterEvent(const fn_call& /*fn*/)
+{
+    LOG_ONCE(log_unimpl("updateAfterEvent()"));
+    return as_value();
+}
+
+as_value
+local_errorConstructor(const fn_call& fn)
+{
+    as_object* obj = ensure<ValidThis>(fn);
+    const as_value& arg = fn.nargs ? fn.arg(0) : as_value();
+    string_table& st = getStringTable(fn);
+    obj->set_member(st.find("message"), arg);
+    return as_value();
+}
+
+
+/// Sets a range of Error subclasses.
+as_value
+global_assetuperror(const fn_call& fn)
+{
+    if (!fn.nargs) return as_value();
+
+    // This should actually call String.split, but since our Array is
+    // wrong we may as well do it like this for now.
+    const std::string& errors = fn.arg(0).to_string();
+
+    std::string::const_iterator pos = errors.begin();
+
+    Global_as& gl = getGlobal(fn);
+
+    // pos is always the position after the last located error.
+    for (;;) {
+
+        // If there are no further commas, find the end of the string.
+        std::string::const_iterator comma = std::find(pos, errors.end(), ',');
+
+        const std::string& err = std::string(pos, comma);
+
+        string_table& st = getStringTable(fn);
+
+        as_function* ctor = getMember(gl, NSV::CLASS_ERROR).to_function();
+        if (ctor) {
+            fn_call::Args args;
+            as_object* proto = constructInstance(*ctor, fn.env(), args);
+
+            // Not really sure what the point of this is.
+            gl.createClass(local_errorConstructor, proto);
+            proto->set_member(st.find("name"), err);
+            proto->set_member(st.find("message"), err);
+        }
+        
+        if (comma == errors.end()) break;
+        pos = comma + 1;
+    }
+    return as_value();
+}
+
+as_value
+global_setInterval(const fn_call& fn)
+{
+    
+       if (fn.nargs < 2) {
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setInterval(%s) "
+                               "- need at least 2 arguments",
+                               ss.str());
+               );
+               return as_value();
+       }
+
+       unsigned timer_arg = 1;
+
+       as_object* obj = fn.arg(0).to_object(getGlobal(fn));
+       if (!obj) {
+
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setInterval(%s) "
+                               "- first argument is not an object or function",
+                               ss.str());
+               );
+               return as_value();
+       }
+
+    string_table::key methodName(0);
+
+       // Get interval function
+       as_function* as_func = obj->to_function(); 
+       if (!as_func) {
+               methodName = getStringTable(fn).find(fn.arg(1).to_string());
+               timer_arg = 2;
+       }
+
+
+       if (fn.nargs < timer_arg + 1) {
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setInterval(%s) "
+                               "- missing timeout argument",
+                               ss.str());
+        );
+               return as_value();
+       }
+
+       // Get interval time
+       unsigned long ms =
+        static_cast<unsigned long>(fn.arg(timer_arg).to_number());
+       // TODO: check validity of interval time number ?
+
+       // Parse arguments 
+    fn_call::Args args;
+       for (unsigned i = timer_arg + 1; i < fn.nargs; ++i) {
+               args += fn.arg(i);
+       }
+
+       std::auto_ptr<Timer> timer;
+       if (as_func) {
+               timer.reset(new Timer(*as_func, ms, fn.this_ptr, args));
+       }
+       else {
+               timer.reset(new Timer(obj, methodName, ms, args));
+       }
+    
+       movie_root& root = getRoot(fn);
+       int id = root.add_interval_timer(timer);
+       return as_value(id);
+}
+
+as_value
+global_setTimeout(const fn_call& fn)
+{
+    
+       if (fn.nargs < 2) {
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setTimeout(%s) "
+                       "- need at least 2 arguments",
+                       ss.str());
+               );
+               return as_value();
+       }
+
+       unsigned timer_arg = 1;
+
+       as_object* obj = fn.arg(0).to_object(getGlobal(fn));
+       if (!obj) {
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setInterval(%s) "
+                               "- first argument is not an object or function",
+                               ss.str());
+               );
+               return as_value();
+       }
+
+    string_table::key methodName(0);
+
+       // Get interval function
+       as_function* as_func = obj->to_function(); 
+       if (!as_func) {
+               methodName = getStringTable(fn).find(fn.arg(1).to_string());
+               timer_arg = 2;
+       }
+
+
+       if (fn.nargs < timer_arg + 1) {
+               IF_VERBOSE_ASCODING_ERRORS(
+                       std::stringstream ss; fn.dump_args(ss);
+                       log_aserror("Invalid call to setTimeout(%s): missing "
+                "timeout argument", ss.str());
+               );
+               return as_value();
+       }
+
+       // Get interval time
+       unsigned long ms =
+        static_cast<unsigned long>(fn.arg(timer_arg).to_number());
+
+       // Parse arguments 
+    fn_call::Args args;
+       for (unsigned i = timer_arg + 1; i < fn.nargs; ++i) {
+               args += fn.arg(i);
+       }
+
+       std::auto_ptr<Timer> timer;
+       if (as_func) {
+               timer.reset(new Timer(*as_func, ms, fn.this_ptr, args, true));
+       }
+       else {
+               timer.reset(new Timer(obj, methodName, ms, args, true));
+       }
+    
+       movie_root& root = getRoot(fn);
+
+       int id = root.add_interval_timer(timer);
+       return as_value(id);
+}
+  
+as_value
+global_clearInterval(const fn_call& fn)
+{
+    if (!fn.nargs) {
+        IF_VERBOSE_ASCODING_ERRORS(
+                log_aserror("clearInterval requires one argument, got none");
+        );
+        return as_value();
+    }
+
+       int id = int(fn.arg(0).to_number());
+
+       movie_root& root = getRoot(fn);
+       bool ret = root.clear_interval_timer(id);
+       return as_value(ret);
+}
+
+as_value
+global_showRedrawRegions(const fn_call& /*fn*/)
+{
+    LOG_ONCE(log_unimpl("_global.showRedrawRegions"));
+    return as_value();
+}
+
+as_value
+global_enableDebugConsole(const fn_call& /*fn*/)
+{
+    LOG_ONCE(log_unimpl("_global.enableDebugConsole"));
+    return as_value();
+}
+/// Construct an instance of the specified global class.
+//
+/// If the class is not present or is not a constructor function, this
+/// function throws an ActionTypeError.
+//
+/// TODO: consider whether ActionTypeError is an appropriate exception.
+/// TODO: test the other failure cases.
+template<typename T>
+as_object*
+constructObject(Global_as& gl, const T& arg, string_table::key className)
+{
+    as_value clval;
+
+    // This is tested in actionscript.all/Object.as to return an 
+    // undefined value. We throw the exception back to the VM, which pushes
+    // an undefined value onto the stack.
+    if (!gl.get_member(className, &clval) ) {
+        throw ActionTypeError();
+    }
+    
+    // This is not properly tested.
+    if (!clval.is_function()) {
+        throw ActionTypeError();
+    }
+    
+    as_function* ctor = clval.to_function();
+
+    // This is also not properly tested.
+    if (!ctor) throw ActionTypeError();
+
+    fn_call::Args args;
+    args += arg;
+
+    as_environment env(getVM(gl));
+    as_object* ret = constructInstance(*ctor, env, args);
+
+    return ret;
+
+}
+
+void
+registerNatives(as_object& global)
+{
+    
+    VM& vm = getVM(global);
+
+    // ASNew was dropped as an API function but exists
+    // as ASnative.
+    vm.registerNative(global_assetpropflags, 1, 0);
+    vm.registerNative(global_asnew, 2, 0);    
+    vm.registerNative(global_assetnative, 4, 0);    
+    vm.registerNative(global_assetnativeaccessor, 4, 1);
+    vm.registerNative(global_updateAfterEvent, 9, 0);    
+    vm.registerNative(global_escape, 100, 0);
+    vm.registerNative(global_unescape, 100, 1);
+    vm.registerNative(global_parseint, 100, 2);
+    vm.registerNative(global_parsefloat, 100, 3);
+    vm.registerNative(global_trace, 100, 4);
+    vm.registerNative(global_isNaN, 200, 18);
+    vm.registerNative(global_isfinite, 200, 19);
+    vm.registerNative(global_setInterval, 250, 0);
+    vm.registerNative(global_clearInterval, 250, 1);
+    vm.registerNative(global_setTimeout, 250, 2);
+    
+    vm.registerNative(global_showRedrawRegions, 1021, 1);
+
+    registerObjectNative(global);
+    registerFunctionNative(global);
+    registerStringNative(global);
+    registerArrayNative(global);
+    registerNumberNative(global);
+    registerBooleanNative(global);
+    registerMovieClipNative(global);
+    registerSelectionNative(global);
+    registerColorNative(global);
+    registerMathNative(global);
+    registerSystemNative(global);
+    registerAccessibilityNative(global);
+    registerStageNative(global);
+    registerTextFieldNative(global);
+    registerButtonNative(global);
+    registerVideoNative(global);
+    registerMovieClipLoaderNative(global);
+    registerXMLSocketNative(global);
+    registerSharedObjectNative(global);
+    registerKeyNative(global);
+    registerNetStreamNative(global);
+    registerCameraNative(global);
+    registerMicrophoneNative(global);
+    registerTextSnapshotNative(global);
+    registerSoundNative(global);
+    registerLocalConnectionNative(global);
+    registerBitmapFilterNative(global);
+    registerColorTransformNative(global);
+    registerExternalInterfaceNative(global);
+    registerBitmapDataNative(global);
+
+    AsBroadcaster::registerNative(global);
+    registerTextFormatNative(global);
+    registerDateNative(global);
+    Mouse_as::registerNative(global);
+
+    // LoadableObject has natives shared between LoadVars and XML, so 
+    // should be registered first.
+    registerLoadableNative(global);
+    registerXMLNative(global);
+    registerXMLNodeNative(global);
+
+}
+
+} // anonymous namespace
+} // namespace gnash
+
diff --git a/libcore/asobj/Number_as.cpp b/libcore/asobj/Number_as.cpp
index 1f4da5b..fc17a5b 100644
--- a/libcore/asobj/Number_as.cpp
+++ b/libcore/asobj/Number_as.cpp
@@ -101,13 +101,11 @@ as_value
 number_ctor(const fn_call& fn)
 {
     double val = 0;
-    if (fn.nargs > 0)
-    {
+    if (fn.nargs > 0) {
         val = fn.arg(0).to_number();
     }
 
-    if ( ! fn.isInstantiation() )
-    {
+    if (!fn.isInstantiation()) {
         return as_value(val);
     }
 
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 135cf9f..0538979 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -354,8 +354,14 @@ VM::getNative(unsigned int x, unsigned int y) const
     Global_as::ASFunction fun = col->second;
 
     NativeFunction* f = new NativeFunction(*_global, fun);
-    f->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
+    
+    Global_as& gl = *_global;
+
+    as_object* func = getMember(gl, NSV::CLASS_FUNCTION).to_object(gl);
+    if (func) {
+        f->init_member(NSV::PROP_CONSTRUCTOR, getMember(*func,
+                    NSV::PROP_CONSTRUCTOR));
+    }
     return f;
 }
 

http://git.savannah.gnu.org/cgit//commit/?id=eb5947080f6403ff98557b057d944b5138e5f621


commit eb5947080f6403ff98557b057d944b5138e5f621
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Oct 7 10:12:26 2010 +0200

    Remove virtual Global_as interface, create Objects properly.

diff --git a/doc/C/preformatted/gnash_ref.info.in 
b/doc/C/preformatted/gnash_ref.info.in
index a731399..592ad72 100644
--- a/doc/C/preformatted/gnash_ref.info.in
+++ b/doc/C/preformatted/gnash_ref.info.in
@@ -2918,7 +2918,7 @@ as follows:
                    Global_as& gl = getGlobal(where);
 
                    // Create a prototype object
-                   as_object* proto = gl.createObject();
+                   as_object* proto = createObject(gl);
 
                    // Create the class
                    as_object* cl = gl.createClass(&extension_ctor, proto);
diff --git a/doc/C/preformatted/gnashref.html.in 
b/doc/C/preformatted/gnashref.html.in
index 1d95039..8ba382f 100644
--- a/doc/C/preformatted/gnashref.html.in
+++ b/doc/C/preformatted/gnashref.html.in
@@ -2077,7 +2077,7 @@
               Global_as&amp; gl = getGlobal(where);
 
               // Create a prototype object
-              as_object* proto = gl.createObject();
+              as_object* proto = createObject(gl);
 
               // Create the class
               as_object* cl = gl.createClass(&amp;extension_ctor, proto);
diff --git a/doc/C/refmanual/extensions/extensions.xml 
b/doc/C/refmanual/extensions/extensions.xml
index a0bc77c..aabdd7c 100644
--- a/doc/C/refmanual/extensions/extensions.xml
+++ b/doc/C/refmanual/extensions/extensions.xml
@@ -99,7 +99,7 @@
               Global_as&amp; gl = getGlobal(where);
 
               // Create a prototype object
-              as_object* proto = gl.createObject();
+              as_object* proto = createObject(gl);
 
               // Create the class
               as_object* cl = gl.createClass(&amp;extension_ctor, proto);
diff --git a/extensions/dbus/dbus_ext.cpp b/extensions/dbus/dbus_ext.cpp
index 982b27f..d75f499 100644
--- a/extensions/dbus/dbus_ext.cpp
+++ b/extensions/dbus/dbus_ext.cpp
@@ -108,7 +108,7 @@ void
 dbus_class_init(as_object &obj)
 {
     Global_as& gl = getGlobal(obj);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachInterface(*proto);
     as_object* cl = gl.createClass(&dbus_ctor, proto);
        
diff --git a/extensions/dejagnu/dejagnu.cpp b/extensions/dejagnu/dejagnu.cpp
index a9d4bb0..91ebb12 100644
--- a/extensions/dejagnu/dejagnu.cpp
+++ b/extensions/dejagnu/dejagnu.cpp
@@ -145,7 +145,7 @@ void
 dejagnu_class_init(as_object &obj)
 {
     Global_as& gl = getGlobal(obj);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachInterface(*proto);
 
     as_object* cl = gl.createClass(&dejagnu_ctor, proto);
diff --git a/extensions/fileio/fileio.cpp b/extensions/fileio/fileio.cpp
index cfe794c..e9c4905 100644
--- a/extensions/fileio/fileio.cpp
+++ b/extensions/fileio/fileio.cpp
@@ -603,7 +603,7 @@ fileio_class_init(as_object& where, const ObjectURI& /* uri 
*/)
     // GNASH_REPORT_FUNCTION;
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachInterface(*proto);
     as_object* cl = gl.createClass(&fileio_ctor, proto);
     
diff --git a/extensions/lirc/lirc_ext.cpp b/extensions/lirc/lirc_ext.cpp
index 2cbaafa..a561c9d 100644
--- a/extensions/lirc/lirc_ext.cpp
+++ b/extensions/lirc/lirc_ext.cpp
@@ -122,7 +122,7 @@ lirc_class_init(as_object &obj)
 {
 
     Global_as& gl = getGlobal(obj);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachInterface(*proto);
        as_object* cl = gl.createClass(&lirc_ctor, proto);
        obj.init_member("Lirc", cl);
diff --git a/extensions/mysql/mysql_db.cpp b/extensions/mysql/mysql_db.cpp
index 8426195..16f56e5 100644
--- a/extensions/mysql/mysql_db.cpp
+++ b/extensions/mysql/mysql_db.cpp
@@ -409,7 +409,7 @@ extern "C" {
 void mysql_class_init(as_object &obj)
 {
     Global_as& gl = getGlobal(obj);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
        as_object *cl = gl.createClass(&mysql_ctor, proto);
     attachInterface(*proto);
        obj.init_member("MySQL", cl);
diff --git a/libcore/AMFConverter.cpp b/libcore/AMFConverter.cpp
index 9b1693c..e892071 100644
--- a/libcore/AMFConverter.cpp
+++ b/libcore/AMFConverter.cpp
@@ -517,7 +517,7 @@ Reader::readObject()
 {
 
     string_table& st = getStringTable(_global);
-    as_object* obj = _global.createObject(); 
+    as_object* obj = createObject(_global); 
 
 #ifdef GNASH_DEBUG_AMF_DESERIALIZE
     log_debug("amf0 starting read of OBJECT");
diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index f9aae43..c61fa7e 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -920,7 +920,7 @@ button_class_init(as_object& global, const ObjectURI& uri)
 {
     // This is going to be the global Button "class"/"function"
     Global_as& gl = getGlobal(global);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&button_ctor, proto);
     attachButtonInterface(*proto);
 
diff --git a/libcore/ClassHierarchy.h b/libcore/ClassHierarchy.h
index 089619e..a35df51 100644
--- a/libcore/ClassHierarchy.h
+++ b/libcore/ClassHierarchy.h
@@ -23,26 +23,16 @@
 #include "gnashconfig.h"
 #endif
 
-
-#ifdef ENABLE_AVM2
-# include "SafeStack.h"
-# include "Class.h"
-# include "Namespace.h"
-# include "BoundValues.h"
-# include "asException.h"
-# include "Method.h"
-#endif
-
-#include <map>
 #include <string>
-#include <list>
 #include <vector>
-#include <ostream>
+#include <iosfwd>
 
 namespace gnash {
+    class Extension;
+    class as_object;
+}
 
-class Extension;
-class as_object;
+namespace gnash {
 
 /// Register all of the ActionScript classes, with their dependencies.
 class ClassHierarchy
@@ -137,10 +127,10 @@ private:
 };
 
 std::ostream&
-operator<< (std::ostream& os, const ClassHierarchy::NativeClass& c);
+operator<<(std::ostream& os, const ClassHierarchy::NativeClass& c);
 
 std::ostream&
-operator<< (std::ostream& os, const ClassHierarchy::ExtensionClass& c);
+operator<<(std::ostream& os, const ClassHierarchy::ExtensionClass& c);
 
 } 
 #endif 
diff --git a/libcore/ExternalInterface.cpp b/libcore/ExternalInterface.cpp
index 450b9b4..a7d7af7 100644
--- a/libcore/ExternalInterface.cpp
+++ b/libcore/ExternalInterface.cpp
@@ -43,7 +43,6 @@
 #include "Array_as.h"
 #include "namedStrings.h"
 #include "Global_as.h"
-#include "Globals.h"
 #include "PropertyList.h"
 #include "movie_root.h"
 #include "log.h"
diff --git a/libcore/Video.cpp b/libcore/Video.cpp
index 8b34b7e..28785b8 100644
--- a/libcore/Video.cpp
+++ b/libcore/Video.cpp
@@ -265,7 +265,7 @@ video_class_init(as_object& global, const ObjectURI& uri)
 {
        // This is going to be the global Video "class"/"function"
     Global_as& gl = getGlobal(global);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&video_ctor, proto);
     attachVideoInterface(*proto);
 
diff --git a/libcore/as_function.cpp b/libcore/as_function.cpp
index 27c75cf..75e6dd3 100644
--- a/libcore/as_function.cpp
+++ b/libcore/as_function.cpp
@@ -206,7 +206,7 @@ getFunctionPrototype()
        if (proto.get() == NULL) {
 
                // Initialize Function prototype
-        proto = VM::get().getGlobal()->createObject();
+        proto = createObject(*VM::get().getGlobal());
         
                // We initialize the __proto__ member separately, as 
getObjectInterface
                // will end up calling getFunctionPrototype again and we want 
that
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index f7f9cdd..cfaa9c5 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -285,7 +285,7 @@ private:
 
 const int as_object::DefaultFlags;
 
-as_object::as_object(Global_as& gl)
+as_object::as_object(const Global_as& gl)
     :
     _displayObject(0),
     _array(false),
@@ -1141,7 +1141,7 @@ getObjectWithPrototype(Global_as& gl, string_table::key c)
     as_object* proto = ctor ?
         getMember(*ctor, NSV::PROP_PROTOTYPE).to_object(gl) : 0;
 
-    as_object* o = gl.createObject();
+    as_object* o = createObject(gl);
     o->set_prototype(proto ? proto : as_value());
     return o;
 }
diff --git a/libcore/as_object.h b/libcore/as_object.h
index 4d8e180..5892843 100644
--- a/libcore/as_object.h
+++ b/libcore/as_object.h
@@ -191,7 +191,7 @@ public:
     /// @param  global  A reference to the Global object the new
     ///                 object ultimately belongs to. The created object
     ///                 uses the resources of the Global object.
-    explicit as_object(Global_as& global);
+    explicit as_object(const Global_as& global);
 
     /// The as_object dtor does nothing special.
     virtual ~as_object() {}
diff --git a/libcore/asobj/Accessibility_as.cpp 
b/libcore/asobj/Accessibility_as.cpp
index 0e98a93..3cedbc8 100644
--- a/libcore/asobj/Accessibility_as.cpp
+++ b/libcore/asobj/Accessibility_as.cpp
@@ -48,7 +48,7 @@ accessibility_class_init(as_object& where, const ObjectURI& 
uri)
     const int flags = as_object::DefaultFlags | PropFlags::readOnly;
 
     // This object has unusual properties.
-    as_object* obj = gl.createObject();
+    as_object* obj = createObject(gl);
     obj->set_member_flags(NSV::PROP_uuPROTOuu, flags);
     obj->init_member(NSV::PROP_CONSTRUCTOR, getMember(gl, NSV::CLASS_OBJECT),
             flags);
diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index 1abd0c2..d0aa32c 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -872,7 +872,7 @@ array_class_init(as_object& where, const ObjectURI& uri)
     VM& vm = getVM(where);
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
 
     as_object* cl = vm.getNative(252, 0);
 
diff --git a/libcore/asobj/Boolean_as.cpp b/libcore/asobj/Boolean_as.cpp
index d08b6c6..8701dce 100644
--- a/libcore/asobj/Boolean_as.cpp
+++ b/libcore/asobj/Boolean_as.cpp
@@ -64,7 +64,7 @@ boolean_class_init(as_object& where, const ObjectURI& uri)
     VM& vm = getVM(where);
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = vm.getNative(107, 2);
     cl->init_member(NSV::PROP_PROTOTYPE, proto);
     proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
diff --git a/libcore/asobj/Camera_as.cpp b/libcore/asobj/Camera_as.cpp
index c7d7984..aff962d 100644
--- a/libcore/asobj/Camera_as.cpp
+++ b/libcore/asobj/Camera_as.cpp
@@ -279,7 +279,7 @@ camera_get(const fn_call& fn)
     // Normally the VM would furnish us with a newly instantiated object, if
     // a constructor were used. But we're in a factory, so we have to build
     // one for ourselves.
-    as_object* cam_obj = getGlobal(fn).createObject();
+    as_object* cam_obj = createObject(getGlobal(fn));
     cam_obj->set_prototype(proto);
     attachCameraInterface(*cam_obj);
     attachCameraProperties(*cam_obj);
diff --git a/libcore/asobj/Color_as.cpp b/libcore/asobj/Color_as.cpp
index a910231..abb3212 100644
--- a/libcore/asobj/Color_as.cpp
+++ b/libcore/asobj/Color_as.cpp
@@ -130,7 +130,7 @@ color_gettransform(const fn_call& fn)
        // Convert to as_object
 
     Global_as& gl = getGlobal(fn);
-       as_object* ret = gl.createObject();
+       as_object* ret = createObject(gl);
 
        ret->init_member("ra", double(cx.ra / 2.56));
        ret->init_member("ga", double(cx.ga / 2.56));
diff --git a/libcore/asobj/ContextMenu_as.cpp b/libcore/asobj/ContextMenu_as.cpp
index 19e122e..c0331c7 100644
--- a/libcore/asobj/ContextMenu_as.cpp
+++ b/libcore/asobj/ContextMenu_as.cpp
@@ -109,7 +109,7 @@ contextmenu_hideBuiltInItems(const fn_call& fn)
     string_table& st = getStringTable(fn);
 
     Global_as& gl = getGlobal(fn);
-    as_object* builtIns = gl.createObject();
+    as_object* builtIns = createObject(gl);
     setBuiltInItems(*builtIns, false);
     ptr->set_member(st.find("builtInItems"), builtIns);
     return as_value();
@@ -185,7 +185,7 @@ contextmenu_ctor(const fn_call& fn)
     
     string_table& st = getStringTable(fn);
     Global_as& gl = getGlobal(fn);
-    as_object* builtInItems = gl.createObject();
+    as_object* builtInItems = createObject(gl);
     setBuiltInItems(*builtInItems, true);
     obj->set_member(st.find("builtInItems"), builtInItems);
 
diff --git a/libcore/asobj/Date_as.cpp b/libcore/asobj/Date_as.cpp
index 96209d4..aca26a4 100644
--- a/libcore/asobj/Date_as.cpp
+++ b/libcore/asobj/Date_as.cpp
@@ -207,7 +207,7 @@ date_class_init(as_object& global, const ObjectURI& uri)
 {
 
     Global_as& gl = getGlobal(global);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&date_new, proto);
     attachDateInterface(*proto);
     
diff --git a/libcore/asobj/Global_as.h b/libcore/asobj/Global_as.h
index b7464ae..1b6fc16 100644
--- a/libcore/asobj/Global_as.h
+++ b/libcore/asobj/Global_as.h
@@ -26,17 +26,19 @@
 #include <boost/preprocessor/repetition/repeat.hpp>
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
 #include <boost/preprocessor/seq/for_each.hpp>
+#include <boost/scoped_ptr.hpp>
 
 #include "as_object.h" 
 #include "fn_call.h"
 #include "log.h"
+#include "ClassHierarchy.h"
 
 // Forward declarations
 namespace gnash {
-       class builtin_function;
-       class as_value;
-       class VM;
-       class ClassHierarchy;
+    class builtin_function;
+    class as_value;
+    class VM;
+    class Extension;
 }
 
 namespace gnash {
@@ -56,69 +58,52 @@ public:
     typedef as_value(*ASFunction)(const fn_call& fn);
     typedef void(*Properties)(as_object&);
 
-    virtual const ClassHierarchy& classHierarchy() const = 0;
-    virtual ClassHierarchy& classHierarchy() = 0;
+       explicit Global_as(VM& vm);
+       virtual ~Global_as();
+    
+    void registerClasses();
+
+    as_object* createString(const std::string& s);
 
-    explicit Global_as(VM& vm)
-        :
-        as_object(vm)
-    {}
+    as_object* createNumber(double d);
 
+    as_object* createBoolean(bool b);
+    
+    as_object* createArray();
+
+    VM& getVM() const {
+        return vm();
+    }
+    
     /// Create an ActionScript function
-    virtual builtin_function* createFunction(ASFunction function) = 0;
+    builtin_function* createFunction(Global_as::ASFunction function);
 
     /// Create an ActionScript class
     //
-    /// The type of a class is different in AS2 and AS3. In AS2 it is generally
-    /// a function (the constructor) with a prototype. In AS3 it is generally
-    /// an object (the prototype) with a constructor.
-    virtual as_object* createClass(ASFunction ctor, as_object* prototype) = 0;
-
-    /// Create a String object
-    //
-    /// This calls the String constructor. If that has been changed, this
-    /// function may not produce a String object. This is generally
-    /// expected behaviour.
-    virtual as_object* createString(const std::string& s) = 0;
+    /// An AS2 class is generally a function (the constructor) with a
+    /// prototype.
+    as_object* createClass(Global_as::ASFunction ctor,
+            as_object* prototype);
 
-    /// Create a Number object
-    //
-    /// This calls the Number constructor. If that has been changed, this
-    /// function may not produce a Number object. This is generally
-    /// expected behaviour.
-    virtual as_object* createNumber(double d) = 0;
+    void makeObject(as_object& o) const;
 
-    /// Create a Boolean object
-    //
-    /// This calls the Boolean constructor. If that has been changed, this
-    /// function may not produce a Boolean object. This is generally
-    /// expected behaviour.
-    virtual as_object* createBoolean(bool b) = 0;
+protected:
+    
+    virtual void markReachableResources() const;
 
-    /// Create an Array object
-    //
-    /// This creates an Array object without calling the Array constructor.
-    virtual as_object* createArray() = 0;
+private:
 
-    /// Create an Object
-    //
-    /// This function returns an Object with Object.prototype as its
-    /// __proto__ member. It should probably call the Object constructor,
-    /// but Gnash creates some of its classes on demand. If the Object class
-    /// has changed before this happens, Gnash's behaviour would differ from
-    /// the reference player's.
-    //
-    /// TODO: think whether it's better to return the original Object class,
-    /// a possibly altered one, or allow both.
-    virtual as_object* createObject() = 0;
+    void loadExtensions();
+    boost::scoped_ptr<Extension> _et;
 
-    virtual Global_as& global() {
-        return *this;
-    }
+    ClassHierarchy _classes;
+    
+    as_object* _objectProto;
 
-    virtual VM& getVM() const = 0;
 };
 
+as_object* createObject(const Global_as& gl);
+    
 
 /// Register a built-in object
 //
@@ -143,7 +128,7 @@ registerBuiltinObject(as_object& where, 
Global_as::Properties p,
 
     // This is going to be the global Mouse "class"/"function"
     Global_as& gl = getGlobal(where);
-    as_object* obj = gl.createObject();
+    as_object* obj = createObject(gl);
     if (p) p(*obj);
     
     where.init_member(uri, obj, as_object::DefaultFlags);
@@ -173,7 +158,7 @@ registerBuiltinClass(as_object& where, 
Global_as::ASFunction ctor,
         Global_as::Properties p, Global_as::Properties c, const ObjectURI& uri)
 {
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(ctor, proto);
  
     // Attach class properties to class
diff --git a/libcore/asobj/Globals.cpp b/libcore/asobj/Globals.cpp
deleted file mode 100644
index 400a7e2..0000000
--- a/libcore/asobj/Globals.cpp
+++ /dev/null
@@ -1,1268 +0,0 @@
-// Global.cpp:  Global ActionScript class setup, for Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-//   Foundation, Inc
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "as_object.h"
-#include "movie_root.h"
-#include "PropFlags.h"
-#include "as_value.h"
-#include "as_function.h" // for function_class_init
-#include "NativeFunction.h" 
-#include "AsBroadcaster.h"
-#include "Boolean_as.h"
-#include "Color_as.h"
-#include "CustomActions.h"
-#include "Date_as.h" 
-#include "Array_as.h" 
-#include "Error_as.h"
-#include "String_as.h"
-#include "Selection_as.h"
-#include "Number_as.h"
-#include "Math_as.h"
-#include "Accessibility_as.h"
-#include "ContextMenu_as.h"
-#include "ContextMenuItem_as.h"
-#include "Key_as.h"
-#include "Mouse_as.h"
-#include "Microphone_as.h"
-#include "Sound_as.h"
-#include "Camera_as.h"
-#include "Stage_as.h"
-#include "MovieClip_as.h"
-#include "flash/display/BitmapData_as.h"
-#include "flash/filters/BitmapFilter_as.h"
-#include "flash/geom/ColorTransform_as.h"
-#include "LocalConnection_as.h"
-#include "XMLSocket_as.h"
-#include "SharedObject_as.h"
-#include "NetConnection_as.h"
-#include "NetStream_as.h"
-#include "System_as.h"
-#include "TextSnapshot_as.h"
-#include "TextField_as.h"
-#include "TextFormat_as.h"
-#include "flash/text/TextRenderer_as.h"
-#include "XML_as.h"
-#include "XMLNode_as.h"
-#include "flash/external/ExternalInterface_as.h"
-#include "MovieClipLoader.h"
-#include "movie_definition.h"
-#include "Video.h"
-#include "extension.h"
-#include "VM.h"
-#include "Timers.h"
-#include "URL.h" 
-#include "builtin_function.h"
-#include "rc.h"
-#include "ClassHierarchy.h"
-#include "namedStrings.h"
-#include "GnashNumeric.h" // for isfinite replacement
-#include "flash_pkg.h"
-#include "fn_call.h"
-#include "Button.h"
-#include "Globals.h"
-#include "LoadVars_as.h"
-#include "Object.h"
-#include "LoadableObject.h"
-
-#include <map>
-#include <limits> 
-#include <sstream>
-#include <boost/lexical_cast.hpp>
-#include <boost/assign/list_of.hpp>
-
-// Common code to warn and return if a required single arg is not present
-// and to warn if there are extra args.
-#define ASSERT_FN_ARGS_IS_1                        \
-    if (fn.nargs < 1) {                            \
-    IF_VERBOSE_ASCODING_ERRORS(                    \
-            log_aserror(_("%s needs one argument"), __FUNCTION__);        \
-            )                                \
-         return as_value();                            \
-    }                                    \
-    IF_VERBOSE_ASCODING_ERRORS(                        \
-    if (fn.nargs > 1)                        \
-            log_aserror(_("%s has more than one argument"), __FUNCTION__);    \
-    )
-
-namespace gnash {
-
-namespace {
-
-    const ClassHierarchy::NativeClasses& avm1Classes();
-
-    as_value global_trace(const fn_call& fn);
-    as_value global_isNaN(const fn_call& fn);
-    as_value global_isfinite(const fn_call& fn);
-    as_value global_unescape(const fn_call& fn);
-    as_value global_escape(const fn_call& fn);
-    as_value global_parsefloat(const fn_call& fn);
-    as_value global_parseint(const fn_call& fn);
-    as_value global_assetpropflags(const fn_call& fn);
-    as_value global_assetuperror(const fn_call& fn);
-    as_value global_asnative(const fn_call& fn);
-    as_value global_asnew(const fn_call& fn);
-    as_value global_assetnative(const fn_call& fn);
-    as_value global_assetnativeaccessor(const fn_call& fn);
-    as_value global_asconstructor(const fn_call& fn);
-    as_value global_updateAfterEvent(const fn_call& fn);
-    as_value global_setTimeout(const fn_call& fn);
-    as_value global_clearInterval(const fn_call& fn);
-    as_value global_setInterval(const fn_call& fn);
-    
-    // These are present in the standalone, not sure about the plugin.
-    as_value global_enableDebugConsole(const fn_call& fn);
-    as_value global_showRedrawRegions(const fn_call& fn);
-
-    // This is a help function for the silly AsSetupError function.
-    as_value local_errorConstructor(const fn_call& fn);
-    
-    void registerNatives(as_object& global);
-    template<typename T> as_object* constructObject(Global_as& gl, const T& 
arg,
-            string_table::key className);
-}
-    
-as_object*
-AVM1Global::createObject()
-{
-    as_object* obj = new as_object(*this);
-    obj->set_prototype(_objectProto);
-    return obj;
-}
-
-builtin_function*
-AVM1Global::createFunction(Global_as::ASFunction function)
-{
-    as_object* proto = createObject();
-    builtin_function* f = new builtin_function(*this, function);
-    
-    proto->init_member(NSV::PROP_CONSTRUCTOR, f); 
-    
-    f->init_member(NSV::PROP_PROTOTYPE, proto);
-    f->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
-    return f;
-}
-
-as_object*
-AVM1Global::createClass(Global_as::ASFunction ctor, as_object* prototype)
-{
-    as_object* cl = new builtin_function(*this, ctor);
-    
-    if (prototype) {
-        prototype->init_member(NSV::PROP_CONSTRUCTOR, cl); 
-        cl->init_member(NSV::PROP_PROTOTYPE, prototype);
-    }
-    cl->init_member(NSV::PROP_CONSTRUCTOR,
-            as_function::getFunctionConstructor());
-    return cl;
-}
-
-as_object*
-AVM1Global::createString(const std::string& s)
-{
-    // This is not really correct. If there is no String class, to_object()
-    // returns an undefined value, not a null object. The behaviour is the
-    // same for versions 5 to 8.
-    return constructObject(*this, s, NSV::CLASS_STRING);
-}
-
-as_object*
-AVM1Global::createNumber(double d)
-{
-    // This is not really correct. If there is no String class, to_object()
-    // returns an undefined value, not a null object. The behaviour is the
-    // same for versions 5 to 8.
-    return constructObject(*this, d, NSV::CLASS_NUMBER);
-
-}
-
-/// Construct an Array.
-//
-/// This uses the _global Array class to initialize the "constructor" and
-/// "__proto__" properties. If Array.prototype is undefined, those properties
-/// are not added.
-as_object*
-AVM1Global::createArray()
-{
-    as_object* array = new as_object(*this);
-
-    as_value ctor = getMember(*this, NSV::CLASS_ARRAY);
-    as_object* obj = ctor.to_object(*this);
-    if (obj) {
-        as_value proto;
-        if (obj->get_member(NSV::PROP_PROTOTYPE, &proto)) {
-            array->init_member(NSV::PROP_CONSTRUCTOR, ctor);
-            array->set_prototype(getMember(*obj, NSV::PROP_PROTOTYPE));
-        }
-    }
-
-    array->init_member(NSV::PROP_LENGTH, 0.0);
-    array->setArray();
-    return array;
-}
-
-as_object*
-AVM1Global::createBoolean(bool b)
-{
-    return constructObject(*this, b, NSV::CLASS_BOOLEAN);
-}
-
-void 
-AVM1Global::markReachableResources() const
-{
-    _classes.markReachableResources();
-    _objectProto->setReachable();
-    as_object::markReachableResources();
-}
-
-AVM1Global::AVM1Global(VM& vm)
-    :
-    Global_as(vm),
-    _classes(this, &_et),
-    _objectProto(new as_object(*this))
-{
-}
-
-void
-AVM1Global::registerClasses()
-{
-    registerNatives(*this);
-
-    initObjectClass(_objectProto, *this, NSV::CLASS_OBJECT); 
-
-    function_class_init(*this, NSV::CLASS_FUNCTION);
-    string_class_init(*this, NSV::CLASS_STRING); 
-    array_class_init(*this, NSV::CLASS_ARRAY); 
-
-    // No idea why, but it seems there's a NULL _global.o 
-    // defined at player startup...
-    // Probably due to the AS-based initialization 
-    // Not enumerable but overridable and deletable.
-    //
-    as_value nullVal; nullVal.set_null();
-    init_member("o", nullVal, PropFlags::dontEnum);
-
-
-    VM& vm = getVM();
-
-    // _global functions.            
-    // These functions are only available in SWF6+, but this is just
-    // because SWF5 or lower did not have a "_global"
-    // reference at all.
-    init_member("ASnative", createFunction(global_asnative));
-    init_member("ASconstructor", createFunction(global_asconstructor));
-    init_member("ASSetPropFlags", vm.getNative(1, 0));
-    init_member("ASSetNative", vm.getNative(4, 0));
-    init_member("ASSetNativeAccessor", vm.getNative(4, 1));
-    init_member("AsSetupError", createFunction(global_assetuperror));
-    init_member("updateAfterEvent", vm.getNative(9, 0));
-    init_member("trace", vm.getNative(100, 4));
-
-    init_member("setInterval", vm.getNative(250, 0));
-    init_member("clearInterval", vm.getNative(250, 1));
-    init_member("setTimeout", vm.getNative(250, 2));
- 
-    // This is an odd function with no properties. There ought to be
-    // a better way of implementing this. See also TextFormat.getTextExtent.
-    as_function* edc = createFunction(global_enableDebugConsole);
-    edc->clearProperties();
-    init_member("enableDebugConsole", edc);
-    init_member("showRedrawRegions", vm.getNative(1021, 1));
-    
-    string_table& st = getStringTable(*this);
-    init_member("clearTimeout", getMember(*this, st.find("clearInterval")));
-
-    _classes.declareAll(avm1Classes());
-
-    // SWF8 visibility:
-    const string_table::key NS_FLASH = st.find("flash");
-    flash_package_init(*this, NS_FLASH); 
-
-    const int version = vm.getSWFVersion();
-
-    switch (version)
-    {
-        default:
-            // Version 10 or above reported
-        case 9:
-        case 8:
-
-        case 7:
-        case 6:
-
-        case 5:
-        
-            // This is surely not correct, but they are not available
-            // in SWF4
-            init_member("escape", vm.getNative(100, 0));
-            init_member("unescape", vm.getNative(100, 1));
-            init_member("parseInt", vm.getNative(100, 2));
-            init_member("parseFloat", vm.getNative(100, 3));
-            init_member("isNaN", vm.getNative(200, 18));
-            init_member("isFinite", vm.getNative(200, 19));
-
-            init_member("NaN", as_value(NaN));
-            init_member("Infinity", as_value(
-                        std::numeric_limits<double>::infinity()));
-        
-        case 4:
-        case 3:
-        case 2:
-        case 1:
-            break;
-    }
-
-    loadExtensions();
-}
-
-//-----------------------
-// Extensions
-//-----------------------
-// Scan the plugin directories for all plugins, and load them now.
-// FIXME: this should actually be done dynamically, and only
-// if a plugin defines a class that a movie actually wants to
-// use.
-void
-AVM1Global::loadExtensions()
-{
-
-    if ( RcInitFile::getDefaultInstance().enableExtensions() )
-    {
-        log_security(_("Extensions enabled, scanning plugin dir for load"));
-        _et.scanAndLoad(*this);
-    }
-    else
-    {
-        log_security(_("Extensions disabled"));
-    }
-
-}
-
-namespace {
-
-const ClassHierarchy::NativeClasses&
-avm1Classes()
-{
-
-    typedef ClassHierarchy::NativeClass N;
-
-    // Since we maintain separate lists for AVM1 and AVM2, these are all
-    // considered to be in the 'Global' namespace (AVM1 has no namespaces)
-    // An ObjectURI constructed without a namespace is in the global namespace.
-    static const ClassHierarchy::NativeClasses s = boost::assign::list_of
-
-        (N(system_class_init, NSV::CLASS_SYSTEM, 1))
-        (N(stage_class_init, NSV::CLASS_STAGE, 1))
-        (N(movieclip_class_init, NSV::CLASS_MOVIE_CLIP, 3))
-        (N(textfield_class_init, NSV::CLASS_TEXT_FIELD, 3))
-        (N(math_class_init, NSV::CLASS_MATH, 4))
-        (N(boolean_class_init, NSV::CLASS_BOOLEAN, 5))
-        (N(button_class_init, NSV::CLASS_BUTTON, 5))
-        (N(color_class_init, NSV::CLASS_COLOR, 5))
-        (N(selection_class_init, NSV::CLASS_SELECTION, 5))
-        (N(sound_class_init, NSV::CLASS_SOUND, 5))
-        (N(xmlsocket_class_init, NSV::CLASS_XMLSOCKET, 5))
-        (N(date_class_init, NSV::CLASS_DATE, 5))
-        (N(xmlnode_class_init, NSV::CLASS_XMLNODE, 5))
-        (N(xml_class_init, NSV::CLASS_XML, 5))
-        (N(mouse_class_init, NSV::CLASS_MOUSE, 5))
-        (N(number_class_init, NSV::CLASS_NUMBER, 5))
-        (N(textformat_class_init, NSV::CLASS_TEXT_FORMAT, 5))
-        (N(key_class_init, NSV::CLASS_KEY, 5))
-        (N(AsBroadcaster::init, NSV::CLASS_AS_BROADCASTER, 5))
-        (N(textsnapshot_class_init, NSV::CLASS_TEXT_SNAPSHOT, 5))
-        (N(video_class_init, NSV::CLASS_VIDEO, 6))
-        (N(camera_class_init, NSV::CLASS_CAMERA, 5))
-        (N(microphone_class_init, NSV::CLASS_MICROPHONE, 5))
-        (N(sharedobject_class_init, NSV::CLASS_SHARED_OBJECT, 5))
-        (N(loadvars_class_init, NSV::CLASS_LOAD_VARS, 5))
-        (N(localconnection_class_init, NSV::CLASS_LOCALCONNECTION, 6))
-        (N(customactions_class_init, NSV::CLASS_CUSTOM_ACTIONS, 6))
-        (N(netconnection_class_init, NSV::CLASS_NET_CONNECTION, 6))
-        (N(netstream_class_init, NSV::CLASS_NET_STREAM, 6))
-        (N(contextmenu_class_init, NSV::CLASS_CONTEXTMENU, 5))
-        (N(contextmenuitem_class_init, NSV::CLASS_CONTEXTMENUITEM, 5))
-        (N(moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER, 5))
-        (N(Error_class_init, NSV::CLASS_ERROR, 5))
-        (N(accessibility_class_init, NSV::CLASS_ACCESSIBILITY, 5));
-
-    return s;
-
-}
-
-as_value
-global_trace(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-
-    // Log our argument.
-    //
-    // @@ what if we get extra args?
-    //
-    // @@ Nothing needs special treatment,
-    //    as_value::to_string() will take care of everything
-    log_trace("%s", fn.arg(0).to_string());
-
-    return as_value();
-}
-
-
-as_value
-global_isNaN(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-
-    return as_value(static_cast<bool>(isNaN(fn.arg(0).to_number())));
-}
-
-
-as_value
-global_isfinite(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-
-    return as_value(static_cast<bool>(isFinite(fn.arg(0).to_number())));
-}
-
-/// \brief Encode a string to URL-encoded format
-/// converting all dodgy DisplayObjects to %AB hex sequences
-//
-/// Characters that need escaping are:
-/// - ASCII control DisplayObjects: 0-31 and 127
-/// - Non-ASCII chars: 128-255
-/// - URL syntax DisplayObjects: $ & + , / : ; = ? @
-/// - Unsafe DisplayObjects: SPACE " < > # % { } | \ ^ ~ [ ] `
-/// Encoding is a % followed by two hexadecimal DisplayObjects, case 
insensitive.
-/// See RFC1738 http://www.rfc-editor.org/rfc/rfc1738.txt,
-/// Section 2.2 "URL Character Encoding Issues"
-as_value
-global_escape(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-
-    std::string input = fn.arg(0).to_string();
-    URL::encode(input);
-    return as_value(input);
-}
-
-/// \brief Decode a string from URL-encoded format
-/// converting all hexadecimal sequences to ASCII DisplayObjects.
-//
-/// A sequence to convert is % followed by two case-independent hexadecimal
-/// digits, which is replaced by the equivalent ASCII DisplayObject.
-/// See RFC1738 http://www.rfc-editor.org/rfc/rfc1738.txt,
-/// Section 2.2 "URL Character Encoding Issues"
-as_value
-global_unescape(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-
-    std::string input = fn.arg(0).to_string();
-    URL::decode(input);
-    return as_value(input);
-}
-
-// parseFloat (string)
-as_value
-global_parsefloat(const fn_call& fn)
-{
-    ASSERT_FN_ARGS_IS_1
-    
-    std::istringstream s(fn.arg(0).to_string());
-    double result;
-    
-    if (!(s >> result)) {
-        return as_value(NaN);   
-    }    
-
-    return as_value(result);
-}
-
-// parseInt(string[, base])
-// The second argument, if supplied, is the base.
-// If none is supplied, we have to work out the 
-// base from the string. Decimal, octal and hexadecimal are
-// possible, according to the following rules:
-// 1. If the string starts with 0x or 0X, the number is hex.
-// 2. The 0x or 0X may be *followed* by '-' or '+' to indicate sign. A number
-//    with no sign is positive.
-// 3. If the string starts with 0, -0 or +0 and contains only the 
DisplayObjects
-//    0-7.
-// 4. If the string starts with *any* other sequence of DisplayObjects, 
including
-//    whitespace, it is decimal.
-as_value
-global_parseint(const fn_call& fn)
-{
-    if (!fn.nargs) {
-        IF_VERBOSE_ASCODING_ERRORS(
-            log_aserror(_("%s needs at least one argument"), __FUNCTION__);
-        )
-        return as_value();
-    }
-
-    IF_VERBOSE_ASCODING_ERRORS(
-        if (fn.nargs > 2) {
-            log_aserror(_("%s has more than two arguments"), __FUNCTION__);
-        }
-    )
-
-    const std::string& expr = fn.arg(0).to_string();
-
-    // A second argument specifies the base.
-    // Parsing still starts after any positive/negative 
-    // sign or hex identifier (parseInt("0x123", 8) gives
-    // 83, not 0; parseInt(" 0x123", 8) is 0), which is
-    // why we do this here.
-    size_t base;
-    if (fn.nargs > 1)
-    {
-        base = toInt(fn.arg(1));
-    
-        // Bases from 2 to 36 are valid, otherwise return NaN
-        if (base < 2 || base > 36) return as_value(NaN);
-    }
-    else
-    {
-        /// No radix specified, so try parsing as octal or hexadecimal
-        try {
-            double d;
-            if (parseNonDecimalInt(expr, d, false)) return d;
-        }
-        catch (boost::bad_lexical_cast&) {
-            return as_value(NaN);
-        }
-
-        /// The number is not hex or octal, so we'll assume it's base-10.
-        base = 10;
-
-    }
-
-    std::string::const_iterator it = expr.begin();
-
-    // Check for expectional case "-0x" or "+0x", which
-    // return NaN
-    if ((expr.length() > 2) && (*it == '-' || *it == '+') &&
-            *(it + 1) == '0' && std::toupper(*(it + 2)) == 'X') {
-        return as_value(NaN);
-    }
-    
-    // Try hexadecimal first
-    if (expr.substr(0, 2) == "0x" || expr.substr(0, 2) == "0X") it += 2;
-    else {
-        // Skip leading whitespace
-        while(*it == ' ' || *it == '\n' || *it == '\t' || *it == '\r') {
-            ++it;
-        }
-        if (it == expr.end()) return as_value(NaN);
-    }    
-
-    bool negative = false;
-    if (*it == '-' || *it == '+')
-    {
-        if (*it == '-') negative = true;
-        
-        it++;
-        if (it == expr.end()) return as_value(NaN);
-    }
-    
-    // Now we have the base, parse the digits. The iterator should
-    // be pointing at the first digit.
-    
-    const std::string digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
-    // Check to see if the first digit is valid, otherwise 
-    // return NaN.
-    std::string::size_type digit = digits.find(toupper(*it));
-
-    if (digit >= base || digit == std::string::npos) return as_value(NaN);
-
-    // The first digit was valid, so continue from the present position
-    // until we reach the end of the string or an invalid DisplayObject,
-    // adding valid DisplayObjects to our result.
-    // Which DisplayObjects are invalid depends on the base. 
-    double result = digit;
-    ++it;
-    
-    while (it != expr.end() && (digit = digits.find(toupper(*it))) < base
-            && digit != std::string::npos) {
-        result = result * base + digit;
-        ++it;
-    }
-
-    // Now return the parsed string as an integer.
-    return negative ? as_value(-result) : as_value(result);
-}
-
-// ASSetPropFlags function
-as_value
-global_assetpropflags(const fn_call& fn)
-{
-
-    if (fn.nargs < 3) {
-        IF_VERBOSE_ASCODING_ERRORS(    
-            log_aserror(_("%s needs at least three arguments"), __FUNCTION__);
-        )
-        return as_value();
-    }
-    
-    IF_VERBOSE_ASCODING_ERRORS(
-        if (fn.nargs > 4) {
-            log_aserror(_("%s has more than four arguments"), 
"AsSetPropFlags");
-        }
-    );
-    
-    // object
-    boost::intrusive_ptr<as_object> obj = fn.arg(0).to_object(getGlobal(fn));
-    if ( ! obj ) {
-        IF_VERBOSE_ASCODING_ERRORS(
-        log_aserror(_("Invalid call to ASSetPropFlags: "
-            "first argument is not an object: %s"),
-            fn.arg(0));
-        );
-        return as_value();
-    }
-
-    // list of child names
-
-    const as_value& props = fn.arg(1);
-
-    const int flagsMask = PropFlags::dontEnum |
-                          PropFlags::dontDelete |
-                          PropFlags::readOnly |
-                          PropFlags::onlySWF6Up |
-                          PropFlags::ignoreSWF6 |
-                          PropFlags::onlySWF7Up |
-                          PropFlags::onlySWF8Up |
-                          PropFlags::onlySWF9Up;
-
-    // a number which represents three bitwise flags which
-    // are used to determine whether the list of child names should be hidden,
-    // un-hidden, protected from over-write, un-protected from over-write,
-    // protected from deletion and un-protected from deletion
-    const int setTrue = int(fn.arg(2).to_number()) & flagsMask;
-
-    // Is another integer bitmask that works like set_true,
-    // except it sets the attributes to false. The
-    // set_false bitmask is applied before set_true is applied
-
-    // ASSetPropFlags was exposed in Flash 5, however the fourth argument
-    // 'set_false' was not required as it always defaulted to the value '~0'. 
-    const int setFalse = (fn.nargs < 4 ? 0 : toInt(fn.arg(3))) &
-        flagsMask;
-
-    obj->setPropFlags(props, setFalse, setTrue);
-
-    return as_value();
-}
-
-// ASconstructor function
-// See: http://osflash.org/flashcoders/undocumented/asnative?s=asnative
-as_value
-global_asconstructor(const fn_call& fn)
-{
-
-    if (fn.nargs < 2) {
-        IF_VERBOSE_ASCODING_ERRORS(    
-            std::ostringstream ss; fn.dump_args(ss);
-            log_aserror(_("ASNative(%s): needs at least two arguments"),
-                ss.str());
-        )
-        return as_value();
-    }
-
-    const int sx = toInt(fn.arg(0));
-    const int sy = toInt(fn.arg(1));
-
-    if (sx < 0 || sy < 0) {
-        IF_VERBOSE_ASCODING_ERRORS(    
-            std::ostringstream ss; fn.dump_args(ss);
-            log_aserror(_("ASconstructor(%s): args must be 0 or above"),
-                ss.str());
-        )
-        return as_value();
-    }
-
-    const unsigned int x = static_cast<unsigned int>(sx);
-    const unsigned int y = static_cast<unsigned int>(sy);
-
-    VM& vm = getVM(fn);
-    as_function* fun = vm.getNative(x, y);
-    if (!fun) {
-        log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
-        return as_value();
-    }
-
-    Global_as& gl = getGlobal(fn);
-    fun->init_member(NSV::PROP_PROTOTYPE, gl.createObject());
-
-    return as_value(fun);
-        
-}
-
-// ASNative function
-// See: http://osflash.org/flashcoders/undocumented/asnative?s=asnative
-as_value
-global_asnative(const fn_call& fn)
-{
-
-    if (fn.nargs < 2)
-    {
-        IF_VERBOSE_ASCODING_ERRORS(    
-            std::ostringstream ss; fn.dump_args(ss);
-            log_aserror(_("ASNative(%s): needs at least two arguments"),
-                ss.str());
-        )
-        return as_value();
-    }
-
-    const int sx = toInt(fn.arg(0));
-    const int sy = toInt(fn.arg(1));
-
-    if (sx < 0 || sy < 0) {
-        IF_VERBOSE_ASCODING_ERRORS(    
-            std::ostringstream ss; fn.dump_args(ss);
-            log_aserror(_("ASnative(%s): args must be 0 or above"),
-                ss.str());
-        )
-        return as_value();
-    }
-
-    const unsigned int x = static_cast<unsigned int>(sx);
-    const unsigned int y = static_cast<unsigned int>(sy);
-
-    VM& vm = getVM(fn);
-    as_function* fun = vm.getNative(x, y);
-    if (!fun) {
-        log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
-        return as_value();
-    }
-    return as_value(fun);
-        
-}
-
-// Obsolete ASnew function (exists only as ASnative(2, 0))
-as_value
-global_asnew(const fn_call& /*fn*/)
-{
-    LOG_ONCE(log_unimpl("ASNative (2, 0) - old ASnew"));
-    return as_value();
-}
-
-
-/// ASSetNative(targetObject, major, properties, minor)
-//
-/// Sets a series of properties on targetObject using the native table.
-/// The third argument is generally documented to be an array, but in fact
-/// it is always converted to a string and parsed.
-as_value
-global_assetnative(const fn_call& fn)
-{
-
-    if (fn.nargs < 3) {
-        return as_value();
-    }
-
-    Global_as& gl = getGlobal(fn);
-
-    as_object* targetObject = fn.arg(0).to_object(gl);
-    if (!targetObject) {
-        return as_value();
-    }
-
-    const int major = toInt(fn.arg(1));
-    if (major < 0) return as_value();
-
-    const std::string& props = fn.arg(2).to_string();
-    const int minor =
-        fn.nargs > 3 ? std::max<boost::int32_t>(toInt(fn.arg(3)), 0) : 0;
-
-    std::string::const_iterator pos = props.begin();
-
-    VM& vm = getVM(fn);
-
-    size_t i = 0;
-
-    // pos is always the position after the last located property.
-    while (pos != props.end()) {
-
-        // If there are no further commas, find the end of the string.
-        std::string::const_iterator comma = std::find(pos, props.end(), ',');
-
-        const char num = *pos;
-        
-        int flag;
-
-        switch (num) {
-            case '6':
-                flag = PropFlags::onlySWF6Up;
-                ++pos;
-                break;
-            case '7':
-                flag = PropFlags::onlySWF7Up;
-                ++pos;
-                break;
-            case '8':
-                flag = PropFlags::onlySWF8Up;
-                ++pos;
-                break;
-            case '9':
-                flag = PropFlags::onlySWF9Up;
-                ++pos;
-                break;
-            default:
-                flag = 0;
-
-        }
-        const std::string& property = std::string(pos, comma);
-        if (!property.empty()) {
-            targetObject->init_member(property,
-                    vm.getNative(major, minor + i), flag);
-        }
-        if (comma == props.end()) break;
-        pos = comma + 1;
-        ++i;
-    }
-    return as_value();
-}
-
-// This is like ASSetNative, but attaches getter/setters.
-as_value
-global_assetnativeaccessor(const fn_call& fn)
-{
-    if (fn.nargs < 3) {
-        return as_value();
-    }
-
-    Global_as& gl = getGlobal(fn);
-
-    as_object* targetObject = fn.arg(0).to_object(gl);
-    if (!targetObject) {
-        return as_value();
-    }
-
-    const int major = toInt(fn.arg(1));
-    if (major < 0) return as_value();
-
-    const std::string& props = fn.arg(2).to_string();
-    const int minor =
-        fn.nargs > 3 ? std::max<boost::int32_t>(toInt(fn.arg(3)), 0) : 0;
-
-    std::string::const_iterator pos = props.begin();
-
-    VM& vm = getVM(fn);
-
-    size_t i = 0;
-
-    // pos is always the position after the last located property.
-    while (pos != props.end()) {
-
-        // If there are no further commas, find the end of the string.
-        std::string::const_iterator comma = std::find(pos, props.end(), ',');
-
-        const char num = *pos;
-        
-        int flag;
-
-        switch (num) {
-            case '6':
-                flag = PropFlags::onlySWF6Up;
-                ++pos;
-                break;
-            case '7':
-                flag = PropFlags::onlySWF7Up;
-                ++pos;
-                break;
-            case '8':
-                flag = PropFlags::onlySWF8Up;
-                ++pos;
-                break;
-            case '9':
-                flag = PropFlags::onlySWF9Up;
-                ++pos;
-                break;
-            default:
-                flag = 0;
-
-        }
-        const std::string& property = std::string(pos, comma);
-        if (!property.empty()) {
-            NativeFunction* getset = vm.getNative(major, minor + i);
-            targetObject->init_property(property, *getset, *getset, flag);
-        }
-        if (comma == props.end()) break;
-        pos = comma + 1;
-        ++i;
-    }
-    return as_value();
-    LOG_ONCE(log_unimpl("ASSetNativeAccessor"));
-    return as_value();
-}
-
-
-// updateAfterEvent function
-as_value
-global_updateAfterEvent(const fn_call& /*fn*/)
-{
-    LOG_ONCE(log_unimpl("updateAfterEvent()"));
-    return as_value();
-}
-
-as_value
-local_errorConstructor(const fn_call& fn)
-{
-    as_object* obj = ensure<ValidThis>(fn);
-    const as_value& arg = fn.nargs ? fn.arg(0) : as_value();
-    string_table& st = getStringTable(fn);
-    obj->set_member(st.find("message"), arg);
-    return as_value();
-}
-
-
-/// Sets a range of Error subclasses.
-as_value
-global_assetuperror(const fn_call& fn)
-{
-    if (!fn.nargs) return as_value();
-
-    // This should actually call String.split, but since our Array is
-    // wrong we may as well do it like this for now.
-    const std::string& errors = fn.arg(0).to_string();
-
-    std::string::const_iterator pos = errors.begin();
-
-    Global_as& gl = getGlobal(fn);
-
-    // pos is always the position after the last located error.
-    for (;;) {
-
-        // If there are no further commas, find the end of the string.
-        std::string::const_iterator comma = std::find(pos, errors.end(), ',');
-
-        const std::string& err = std::string(pos, comma);
-
-        string_table& st = getStringTable(fn);
-
-        as_function* ctor = getMember(gl, NSV::CLASS_ERROR).to_function();
-        if (ctor) {
-            fn_call::Args args;
-            as_object* proto = constructInstance(*ctor, fn.env(), args);
-
-            // Not really sure what the point of this is.
-            gl.createClass(local_errorConstructor, proto);
-            proto->set_member(st.find("name"), err);
-            proto->set_member(st.find("message"), err);
-        }
-        
-        if (comma == errors.end()) break;
-        pos = comma + 1;
-    }
-    return as_value();
-}
-
-as_value
-global_setInterval(const fn_call& fn)
-{
-    
-       if (fn.nargs < 2) {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setInterval(%s) "
-                               "- need at least 2 arguments",
-                               ss.str());
-               );
-               return as_value();
-       }
-
-       unsigned timer_arg = 1;
-
-       as_object* obj = fn.arg(0).to_object(getGlobal(fn));
-       if (!obj) {
-
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setInterval(%s) "
-                               "- first argument is not an object or function",
-                               ss.str());
-               );
-               return as_value();
-       }
-
-    string_table::key methodName(0);
-
-       // Get interval function
-       as_function* as_func = obj->to_function(); 
-       if (!as_func) {
-               methodName = getStringTable(fn).find(fn.arg(1).to_string());
-               timer_arg = 2;
-       }
-
-
-       if (fn.nargs < timer_arg + 1) {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setInterval(%s) "
-                               "- missing timeout argument",
-                               ss.str());
-        );
-               return as_value();
-       }
-
-       // Get interval time
-       unsigned long ms =
-        static_cast<unsigned long>(fn.arg(timer_arg).to_number());
-       // TODO: check validity of interval time number ?
-
-       // Parse arguments 
-    fn_call::Args args;
-       for (unsigned i = timer_arg + 1; i < fn.nargs; ++i) {
-               args += fn.arg(i);
-       }
-
-       std::auto_ptr<Timer> timer;
-       if (as_func) {
-               timer.reset(new Timer(*as_func, ms, fn.this_ptr, args));
-       }
-       else {
-               timer.reset(new Timer(obj, methodName, ms, args));
-       }
-    
-       movie_root& root = getRoot(fn);
-       int id = root.add_interval_timer(timer);
-       return as_value(id);
-}
-
-as_value
-global_setTimeout(const fn_call& fn)
-{
-    
-       if (fn.nargs < 2) {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setTimeout(%s) "
-                       "- need at least 2 arguments",
-                       ss.str());
-               );
-               return as_value();
-       }
-
-       unsigned timer_arg = 1;
-
-       as_object* obj = fn.arg(0).to_object(getGlobal(fn));
-       if (!obj) {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setInterval(%s) "
-                               "- first argument is not an object or function",
-                               ss.str());
-               );
-               return as_value();
-       }
-
-    string_table::key methodName(0);
-
-       // Get interval function
-       as_function* as_func = obj->to_function(); 
-       if (!as_func) {
-               methodName = getStringTable(fn).find(fn.arg(1).to_string());
-               timer_arg = 2;
-       }
-
-
-       if (fn.nargs < timer_arg + 1) {
-               IF_VERBOSE_ASCODING_ERRORS(
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror("Invalid call to setTimeout(%s): missing "
-                "timeout argument", ss.str());
-               );
-               return as_value();
-       }
-
-       // Get interval time
-       unsigned long ms =
-        static_cast<unsigned long>(fn.arg(timer_arg).to_number());
-
-       // Parse arguments 
-    fn_call::Args args;
-       for (unsigned i = timer_arg + 1; i < fn.nargs; ++i) {
-               args += fn.arg(i);
-       }
-
-       std::auto_ptr<Timer> timer;
-       if (as_func) {
-               timer.reset(new Timer(*as_func, ms, fn.this_ptr, args, true));
-       }
-       else {
-               timer.reset(new Timer(obj, methodName, ms, args, true));
-       }
-    
-       movie_root& root = getRoot(fn);
-
-       int id = root.add_interval_timer(timer);
-       return as_value(id);
-}
-  
-as_value
-global_clearInterval(const fn_call& fn)
-{
-    if (!fn.nargs) {
-        IF_VERBOSE_ASCODING_ERRORS(
-                log_aserror("clearInterval requires one argument, got none");
-        );
-        return as_value();
-    }
-
-       int id = int(fn.arg(0).to_number());
-
-       movie_root& root = getRoot(fn);
-       bool ret = root.clear_interval_timer(id);
-       return as_value(ret);
-}
-
-as_value
-global_showRedrawRegions(const fn_call& /*fn*/)
-{
-    LOG_ONCE(log_unimpl("_global.showRedrawRegions"));
-    return as_value();
-}
-
-as_value
-global_enableDebugConsole(const fn_call& /*fn*/)
-{
-    LOG_ONCE(log_unimpl("_global.enableDebugConsole"));
-    return as_value();
-}
-/// Construct an instance of the specified global class.
-//
-/// If the class is not present or is not a constructor function, this
-/// function throws an ActionTypeError.
-//
-/// TODO: consider whether ActionTypeError is an appropriate exception.
-/// TODO: test the other failure cases.
-template<typename T>
-as_object*
-constructObject(Global_as& gl, const T& arg, string_table::key className)
-{
-    as_value clval;
-
-    // This is tested in actionscript.all/Object.as to return an 
-    // undefined value. We throw the exception back to the VM, which pushes
-    // an undefined value onto the stack.
-    if (!gl.get_member(className, &clval) ) {
-        throw ActionTypeError();
-    }
-    
-    // This is not properly tested.
-    if (!clval.is_function()) {
-        throw ActionTypeError();
-    }
-    
-    as_function* ctor = clval.to_function();
-
-    // This is also not properly tested.
-    if (!ctor) throw ActionTypeError();
-
-    fn_call::Args args;
-    args += arg;
-
-    as_environment env(getVM(gl));
-    as_object* ret = constructInstance(*ctor, env, args);
-
-    return ret;
-
-}
-
-void
-registerNatives(as_object& global)
-{
-    
-    VM& vm = getVM(global);
-
-    // ASNew was dropped as an API function but exists
-    // as ASnative.
-    vm.registerNative(global_assetpropflags, 1, 0);
-    vm.registerNative(global_asnew, 2, 0);    
-    vm.registerNative(global_assetnative, 4, 0);    
-    vm.registerNative(global_assetnativeaccessor, 4, 1);
-    vm.registerNative(global_updateAfterEvent, 9, 0);    
-    vm.registerNative(global_escape, 100, 0);
-    vm.registerNative(global_unescape, 100, 1);
-    vm.registerNative(global_parseint, 100, 2);
-    vm.registerNative(global_parsefloat, 100, 3);
-    vm.registerNative(global_trace, 100, 4);
-    vm.registerNative(global_isNaN, 200, 18);
-    vm.registerNative(global_isfinite, 200, 19);
-    vm.registerNative(global_setInterval, 250, 0);
-    vm.registerNative(global_clearInterval, 250, 1);
-    vm.registerNative(global_setTimeout, 250, 2);
-    
-    vm.registerNative(global_showRedrawRegions, 1021, 1);
-
-    registerObjectNative(global);
-    registerFunctionNative(global);
-    registerStringNative(global);
-    registerArrayNative(global);
-    registerNumberNative(global);
-    registerBooleanNative(global);
-    registerMovieClipNative(global);
-    registerSelectionNative(global);
-    registerColorNative(global);
-    registerMathNative(global);
-    registerSystemNative(global);
-    registerAccessibilityNative(global);
-    registerStageNative(global);
-    registerTextFieldNative(global);
-    registerButtonNative(global);
-    registerVideoNative(global);
-    registerMovieClipLoaderNative(global);
-    registerXMLSocketNative(global);
-    registerSharedObjectNative(global);
-    registerKeyNative(global);
-    registerNetStreamNative(global);
-    registerCameraNative(global);
-    registerMicrophoneNative(global);
-    registerTextSnapshotNative(global);
-    registerSoundNative(global);
-    registerLocalConnectionNative(global);
-    registerBitmapFilterNative(global);
-    registerColorTransformNative(global);
-    registerExternalInterfaceNative(global);
-    registerBitmapDataNative(global);
-
-    AsBroadcaster::registerNative(global);
-    registerTextFormatNative(global);
-    registerDateNative(global);
-    Mouse_as::registerNative(global);
-
-    // LoadableObject has natives shared between LoadVars and XML, so 
-    // should be registered first.
-    registerLoadableNative(global);
-    registerXMLNative(global);
-    registerXMLNodeNative(global);
-
-}
-
-} // anonymous namespace
-} // namespace gnash
-
diff --git a/libcore/asobj/Globals.h b/libcore/asobj/Globals.h
deleted file mode 100644
index fb7958e..0000000
--- a/libcore/asobj/Globals.h
+++ /dev/null
@@ -1,122 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-//   Foundation, Inc
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// This file provides implementations of two different ActionScript global
-/// objects: one for AVM1, one for AVM2.
-//
-/// The AVM1 global object has more (known) global functions. All AS2 classes
-/// are initialized as object prototypes and functions attached to the 
-/// global object. From SWF8, the 'flash' package is attached as follows:
-///
-///                             _global
-///                                 |
-///                               flash
-///                                 |
-///            ---------------------------------------------------
-///            |         |          |          |         |       |
-///         display     net     external    filters     geom    text
-///
-/// where each item is an object.
-///
-/// The AVM2 global object has functions such as trace(), escape(),
-/// parseFloat(), parseInt() in common with AVM1. Some classes, such as
-/// Array, Boolean, Date, String, and Object, are also directly attached.
-/// Other classes, however, are different. The flash package in AVM2 is a 
-/// namespace, not an object, and all members of the flash package are
-/// attached with a namespace to the global object. As we do this on
-/// demand, the AVM2 global object is much emptier than the AVM1 equivalent
-/// to start with.
-#ifndef GNASH_GLOBALS_H
-#define GNASH_GLOBALS_H
-
-#include <string>
-#include "Global_as.h" 
-#include "extension.h"
-#include "ClassHierarchy.h"
-
-// Forward declarations
-namespace gnash {
-    namespace abc {
-        class Machine;
-    }
-       class VM;
-       class fn_call;
-}
-
-namespace gnash {
-
-class AVM1Global : public Global_as
-{
-public:
-
-       AVM1Global(VM& vm);
-       ~AVM1Global() {}
-
-    void registerClasses();
-
-    virtual as_object* createString(const std::string& s);
-
-    virtual as_object* createNumber(double d);
-
-    virtual as_object* createBoolean(bool b);
-    
-    virtual as_object* createObject();
-    
-    virtual as_object* createArray();
-
-    virtual const ClassHierarchy& classHierarchy() const {
-        return _classes;
-    }
-    
-    virtual ClassHierarchy& classHierarchy() {
-        return _classes;
-    }
-
-    virtual VM& getVM() const {
-        return vm();
-    }
-    
-    /// Create an ActionScript function
-    virtual builtin_function* createFunction(Global_as::ASFunction function);
-
-    /// Create an ActionScript class
-    //
-    /// An AS2 class is generally a function (the constructor) with a
-    /// prototype.
-    virtual as_object* createClass(Global_as::ASFunction ctor,
-            as_object* prototype);
-
-protected:
-    
-    virtual void markReachableResources() const;
-
-private:
-
-    void loadExtensions();
-       Extension _et;
-
-    ClassHierarchy _classes;
-    
-    as_object* _objectProto;
-
-};
-
-} // namespace gnash
-
-#endif 
diff --git a/libcore/asobj/Microphone_as.cpp b/libcore/asobj/Microphone_as.cpp
index 7bc817b..55954c7 100644
--- a/libcore/asobj/Microphone_as.cpp
+++ b/libcore/asobj/Microphone_as.cpp
@@ -272,7 +272,7 @@ microphone_get(const fn_call& fn)
     // Normally the VM would furnish us with a newly instantiated object, if
     // a constructor were used. But we're in a factory, so we have to build
     // one for ourselves.
-    as_object* mic_obj = getGlobal(fn).createObject();
+    as_object* mic_obj = createObject(getGlobal(fn));
     mic_obj->set_prototype(proto);
     attachMicrophoneInterface(*mic_obj);
     attachMicrophoneProperties(*mic_obj);
diff --git a/libcore/asobj/MovieClipLoader.cpp 
b/libcore/asobj/MovieClipLoader.cpp
index 151e8cf..886b786 100644
--- a/libcore/asobj/MovieClipLoader.cpp
+++ b/libcore/asobj/MovieClipLoader.cpp
@@ -69,7 +69,7 @@ moviecliploader_class_init(as_object& where, const ObjectURI& 
uri)
        // This is going to be the where Number "class"/"function"
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();;
+    as_object* proto = createObject(gl);;
 
     as_object* cl = gl.createClass(&moviecliploader_new, proto);
     attachMovieClipLoaderInterface(*proto);
diff --git a/libcore/asobj/MovieClip_as.cpp b/libcore/asobj/MovieClip_as.cpp
index dd6c1a9..d3539bc 100644
--- a/libcore/asobj/MovieClip_as.cpp
+++ b/libcore/asobj/MovieClip_as.cpp
@@ -114,7 +114,7 @@ void
 movieclip_class_init(as_object& where, const ObjectURI& uri)
 {
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
 
     as_object* cl = gl.createClass(&movieclip_as2_ctor, proto);
     attachMovieClipAS2Interface(*proto);
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index bda5849..5159478 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -735,7 +735,7 @@ NetConnection_as::notifyStatus(StatusCode code)
     getStatusCodeInfo(code, info);
 
     /// This is a new normal object each time (see NetConnection.as)
-    as_object* o = getGlobal(owner()).createObject();
+    as_object* o = createObject(getGlobal(owner()));
 
     const int flags = 0;
 
diff --git a/libcore/asobj/NetStream_as.cpp b/libcore/asobj/NetStream_as.cpp
index 5770fd5..94a7c01 100644
--- a/libcore/asobj/NetStream_as.cpp
+++ b/libcore/asobj/NetStream_as.cpp
@@ -263,7 +263,7 @@ NetStream_as::getStatusObject(StatusCode code)
     // Enumerable and deletable.
     const int flags = 0;
 
-    as_object* o = getGlobal(owner()).createObject();
+    as_object* o = createObject(getGlobal(owner()));
     o->init_member("code",  info.first, flags);
     o->init_member("level", info.second, flags);
 
diff --git a/libcore/asobj/Number_as.cpp b/libcore/asobj/Number_as.cpp
index 7688e78..1f4da5b 100644
--- a/libcore/asobj/Number_as.cpp
+++ b/libcore/asobj/Number_as.cpp
@@ -155,7 +155,7 @@ number_class_init(as_object& where, const ObjectURI& uri)
     VM& vm = getVM(where);
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = vm.getNative(106, 2);
     cl->init_member(NSV::PROP_PROTOTYPE, proto);
     proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
diff --git a/libcore/asobj/Object.cpp b/libcore/asobj/Object.cpp
index 932a922..d360e9b 100644
--- a/libcore/asobj/Object.cpp
+++ b/libcore/asobj/Object.cpp
@@ -155,7 +155,12 @@ object_ctor(const fn_call& fn)
         return new as_object(gl);
     }
 
-    return gl.createObject();
+    if (fn.this_ptr) {
+        gl.makeObject(*fn.this_ptr);
+    }
+
+    return as_value();
+
 }
 
 /// Object.toString returns one of two values: [type Function] if it is a 
diff --git a/libcore/asobj/SharedObject_as.cpp 
b/libcore/asobj/SharedObject_as.cpp
index 8bec63b..40257ad 100644
--- a/libcore/asobj/SharedObject_as.cpp
+++ b/libcore/asobj/SharedObject_as.cpp
@@ -596,7 +596,7 @@ void
 sharedobject_class_init(as_object& where, const ObjectURI& uri)
 {
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachSharedObjectInterface(*proto);
     as_object* cl = gl.createClass(&sharedobject_ctor, proto);
     attachSharedObjectStaticInterface(*cl);
@@ -890,7 +890,7 @@ readSOL(VM& vm, const std::string& filespec)
     // The 'data' member is initialized only on getLocal() (and probably
     // getRemote()): i.e. when there is some data, or when it's ready to
     // be added.
-    as_object* data = gl.createObject();
+    as_object* data = createObject(gl);
 
     struct stat st;
 
diff --git a/libcore/asobj/Sound_as.cpp b/libcore/asobj/Sound_as.cpp
index 99ba475..b065502 100644
--- a/libcore/asobj/Sound_as.cpp
+++ b/libcore/asobj/Sound_as.cpp
@@ -282,7 +282,7 @@ sound_class_init(as_object& where, const ObjectURI& uri)
 {
 
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&sound_new, proto);
     attachSoundInterface(*proto);
     proto->set_member_flags(NSV::PROP_CONSTRUCTOR, PropFlags::readOnly);
diff --git a/libcore/asobj/String_as.cpp b/libcore/asobj/String_as.cpp
index 1b68f06..6fd5bf7 100644
--- a/libcore/asobj/String_as.cpp
+++ b/libcore/asobj/String_as.cpp
@@ -111,7 +111,7 @@ string_class_init(as_object& where, const ObjectURI& uri)
     VM& vm = getVM(where);
     Global_as& gl = getGlobal(where);
 
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = vm.getNative(251, 0);
     cl->init_member(NSV::PROP_PROTOTYPE, proto);
     proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
diff --git a/libcore/asobj/TextField_as.cpp b/libcore/asobj/TextField_as.cpp
index 078ff0d..4f6cfb4 100644
--- a/libcore/asobj/TextField_as.cpp
+++ b/libcore/asobj/TextField_as.cpp
@@ -108,7 +108,7 @@ textfield_class_init(as_object& where, const ObjectURI& uri)
 {
 
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&textfield_ctor, proto);
 
     attachTextFieldInterface(*proto);
diff --git a/libcore/asobj/TextFormat_as.cpp b/libcore/asobj/TextFormat_as.cpp
index 2209592..ef67b69 100644
--- a/libcore/asobj/TextFormat_as.cpp
+++ b/libcore/asobj/TextFormat_as.cpp
@@ -374,7 +374,7 @@ textformat_class_init(as_object& global, const ObjectURI& 
uri)
 {
 
     Global_as& gl = getGlobal(global);
-    as_object* proto = gl.createObject();;
+    as_object* proto = createObject(gl);;
     as_object* cl = gl.createClass(&textformat_new, proto);
 
        global.init_member(uri, cl, as_object::DefaultFlags);
diff --git a/libcore/asobj/XMLNode_as.cpp b/libcore/asobj/XMLNode_as.cpp
index 86b2213..0a4b7b6 100644
--- a/libcore/asobj/XMLNode_as.cpp
+++ b/libcore/asobj/XMLNode_as.cpp
@@ -122,7 +122,7 @@ XMLNode_as::object()
     // but not quite. There is no __constructor__ property, and when we
     // override _global.XMLNode, we can show that it is not called.
     if (!_object) {
-        as_object* o = _global.createObject();
+        as_object* o = createObject(_global);
         as_object* xn =
             getMember(_global, NSV::CLASS_XMLNODE).to_object(_global);
         if (xn) {
@@ -500,7 +500,7 @@ void
 xmlnode_class_init(as_object& where, const ObjectURI& uri)
 {
     Global_as& gl = getGlobal(where);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachXMLNodeInterface(*proto);
     as_object* cl = gl.createClass(&xmlnode_new, proto);
 
diff --git a/libcore/asobj/flash.am b/libcore/asobj/flash.am
index dd016c0..3a9837d 100644
--- a/libcore/asobj/flash.am
+++ b/libcore/asobj/flash.am
@@ -34,7 +34,7 @@ libgnashasobjs_la_SOURCES = \
        asobj/CustomActions.cpp\
        asobj/Date_as.cpp \
        asobj/Error_as.cpp \
-       asobj/Globals.cpp \
+       asobj/Global_as.cpp \
        asobj/LoadVars_as.cpp \
        asobj/Math_as.cpp \
        asobj/Number_as.cpp \
@@ -76,7 +76,6 @@ inst_HEADERS = \
        asobj/Error_as.h        \
        asobj/Math_as.h \
        asobj/Global_as.h\
-       asobj/Globals.h\
        asobj/LoadVars_as.h \
        asobj/MovieClipLoader.h \
        asobj/Number_as.h \
diff --git a/libcore/asobj/flash/display/BitmapData_as.cpp 
b/libcore/asobj/flash/display/BitmapData_as.cpp
index f4fc295..5e1620b 100644
--- a/libcore/asobj/flash/display/BitmapData_as.cpp
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp
@@ -383,7 +383,7 @@ bitmapdata_clone(const fn_call& fn)
     std::copy(bm->begin(), bm->end(), image::begin<image::ARGB>(*im));
 
     Global_as& gl = getGlobal(fn);
-    as_object* ret = gl.createObject();
+    as_object* ret = createObject(gl);
     const as_value& proto = getMember(*obj, NSV::PROP_uuPROTOuu);
     if (proto.is_object()) {
         ret->set_member(NSV::PROP_uuPROTOuu, proto);
@@ -845,7 +845,7 @@ bitmapdata_loadBitmap(const fn_call& fn)
     
     // The properties come from the 'this' object.
     Global_as& gl = getGlobal(fn);
-    as_object* ret = gl.createObject();
+    as_object* ret = createObject(gl);
     ret->set_member(NSV::PROP_uuPROTOuu, getMember(*ptr, NSV::PROP_PROTOTYPE));
     
     newImage->update(im.begin());
@@ -860,7 +860,7 @@ get_flash_display_bitmap_data_constructor(const fn_call& fn)
 {
     log_debug("Loading flash.display.BitmapData class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachBitmapDataInterface(*proto);
     as_object* cl = gl.createClass(&bitmapdata_ctor, proto);
     attachBitmapDataStaticProperties(*cl);
diff --git a/libcore/asobj/flash/display/display_pkg.cpp 
b/libcore/asobj/flash/display/display_pkg.cpp
index 48c444f..de41756 100644
--- a/libcore/asobj/flash/display/display_pkg.cpp
+++ b/libcore/asobj/flash/display/display_pkg.cpp
@@ -38,7 +38,7 @@ get_flash_display_package(const fn_call& fn)
 
     Global_as& gl = getGlobal(fn);
 
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
     
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 0b8065f..127089a 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -45,7 +45,6 @@
 #include "Array_as.h"
 #include "namedStrings.h"
 #include "Global_as.h"
-#include "Globals.h"
 #include "PropertyList.h"
 #include "movie_root.h"
 #include "log.h"
@@ -400,7 +399,7 @@ externalInterfaceConstructor(const fn_call& fn)
 {
     log_debug("Loading flash.external.ExternalInterface class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&externalinterface_ctor, proto);
 
     attachExternalInterfaceStaticInterface(*cl);
diff --git a/libcore/asobj/flash/external/external_pkg.cpp 
b/libcore/asobj/flash/external/external_pkg.cpp
index 6fc923a..cf8dcf4 100644
--- a/libcore/asobj/flash/external/external_pkg.cpp
+++ b/libcore/asobj/flash/external/external_pkg.cpp
@@ -39,7 +39,7 @@ get_flash_external_package(const fn_call& fn)
 
     Global_as& gl = getGlobal(fn);
 
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
     
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/filters/BitmapFilter_as.cpp 
b/libcore/asobj/flash/filters/BitmapFilter_as.cpp
index b48d093..97f831a 100644
--- a/libcore/asobj/flash/filters/BitmapFilter_as.cpp
+++ b/libcore/asobj/flash/filters/BitmapFilter_as.cpp
@@ -89,7 +89,7 @@ registerBitmapClass(as_object& where, Global_as::ASFunction 
ctor,
     }
     else proto = 0;
 
-    as_object* cl = gl.createClass(ctor, gl.createObject());
+    as_object* cl = gl.createClass(ctor, createObject(gl));
     if (proto) p(*proto);
 
     // The startup script overwrites the prototype assigned by ASconstructor,
@@ -117,7 +117,7 @@ getBitmapFilterConstructor(const fn_call& fn)
     Global_as& gl = getGlobal(fn);
     VM& vm = getVM(fn);
     
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = vm.getNative(1112, 0);
     cl->init_member(NSV::PROP_PROTOTYPE, proto);
     proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
diff --git a/libcore/asobj/flash/filters/filters_pkg.cpp 
b/libcore/asobj/flash/filters/filters_pkg.cpp
index 1c0df6b..e6d6600 100644
--- a/libcore/asobj/flash/filters/filters_pkg.cpp
+++ b/libcore/asobj/flash/filters/filters_pkg.cpp
@@ -47,7 +47,7 @@ get_flash_filters_package(const fn_call& fn)
 
     log_debug("Loading flash.filters package");
     Global_as& gl = getGlobal(fn);
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
 
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/flash_pkg.cpp 
b/libcore/asobj/flash/flash_pkg.cpp
index 33446a1..befbac2 100644
--- a/libcore/asobj/flash/flash_pkg.cpp
+++ b/libcore/asobj/flash/flash_pkg.cpp
@@ -40,7 +40,7 @@ get_flash_package(const fn_call& fn)
 {
     Global_as& gl = getGlobal(fn);
 
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
     
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/geom/ColorTransform_as.cpp 
b/libcore/asobj/flash/geom/ColorTransform_as.cpp
index 4df58ae..ba820f8 100644
--- a/libcore/asobj/flash/geom/ColorTransform_as.cpp
+++ b/libcore/asobj/flash/geom/ColorTransform_as.cpp
@@ -404,7 +404,7 @@ get_flash_geom_color_transform_constructor(const fn_call& 
fn)
 {
     log_debug("Loading flash.geom.ColorTransform class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&colortransform_ctor, proto);
     attachColorTransformInterface(*proto);
     return cl;
diff --git a/libcore/asobj/flash/geom/Matrix_as.cpp 
b/libcore/asobj/flash/geom/Matrix_as.cpp
index f7fdf83..0024b08 100644
--- a/libcore/asobj/flash/geom/Matrix_as.cpp
+++ b/libcore/asobj/flash/geom/Matrix_as.cpp
@@ -895,7 +895,7 @@ get_flash_geom_matrix_constructor(const fn_call& fn)
 {
     log_debug("Loading flash.geom.Matrix class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachMatrixInterface(*proto);
     return gl.createClass(&matrix_ctor, proto);
 }
diff --git a/libcore/asobj/flash/geom/Point_as.cpp 
b/libcore/asobj/flash/geom/Point_as.cpp
index 03d8423..fb053e8 100644
--- a/libcore/asobj/flash/geom/Point_as.cpp
+++ b/libcore/asobj/flash/geom/Point_as.cpp
@@ -625,7 +625,7 @@ get_flash_geom_point_constructor(const fn_call& fn)
 {
     log_debug("Loading flash.geom.Point class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     as_object* cl = gl.createClass(&point_ctor, proto);
     attachPointInterface(*proto);
     attachPointStaticProperties(*cl);
diff --git a/libcore/asobj/flash/geom/Rectangle_as.cpp 
b/libcore/asobj/flash/geom/Rectangle_as.cpp
index c1bf6ea..8072dec 100644
--- a/libcore/asobj/flash/geom/Rectangle_as.cpp
+++ b/libcore/asobj/flash/geom/Rectangle_as.cpp
@@ -677,7 +677,7 @@ get_flash_geom_rectangle_constructor(const fn_call& fn)
 {
     log_debug("Loading flash.geom.Rectangle class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachRectangleInterface(*proto);
     return gl.createClass(&Rectangle_ctor, proto);
 }
diff --git a/libcore/asobj/flash/geom/Transform_as.cpp 
b/libcore/asobj/flash/geom/Transform_as.cpp
index 34f3542..0b688dd 100644
--- a/libcore/asobj/flash/geom/Transform_as.cpp
+++ b/libcore/asobj/flash/geom/Transform_as.cpp
@@ -384,7 +384,7 @@ get_flash_geom_transform_constructor(const fn_call& fn)
 {
     log_debug("Loading flash.geom.Transform class");
     Global_as& gl = getGlobal(fn);
-    as_object* proto = gl.createObject();
+    as_object* proto = createObject(gl);
     attachTransformInterface(*proto);
     return gl.createClass(&transform_ctor, proto);
 }
diff --git a/libcore/asobj/flash/geom/geom_pkg.cpp 
b/libcore/asobj/flash/geom/geom_pkg.cpp
index fcddedc..3bb2a08 100644
--- a/libcore/asobj/flash/geom/geom_pkg.cpp
+++ b/libcore/asobj/flash/geom/geom_pkg.cpp
@@ -41,7 +41,7 @@ get_flash_geom_package(const fn_call& fn)
     log_debug("Loading flash.geom package");
     Global_as& gl = getGlobal(fn);
 
-    as_object *pkg = gl.createObject();
+    as_object *pkg = createObject(gl);
        
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/net/net_pkg.cpp 
b/libcore/asobj/flash/net/net_pkg.cpp
index 454ba48..864984f 100644
--- a/libcore/asobj/flash/net/net_pkg.cpp
+++ b/libcore/asobj/flash/net/net_pkg.cpp
@@ -37,7 +37,7 @@ get_flash_net_package(const fn_call& fn)
  
     Global_as& gl = getGlobal(fn);
 
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
     
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/asobj/flash/text/text_pkg.cpp 
b/libcore/asobj/flash/text/text_pkg.cpp
index 9c609b9..5d0ad18 100644
--- a/libcore/asobj/flash/text/text_pkg.cpp
+++ b/libcore/asobj/flash/text/text_pkg.cpp
@@ -35,7 +35,7 @@ get_flash_text_package(const fn_call& fn)
  
     Global_as& gl = getGlobal(fn);
 
-    as_object* pkg = gl.createObject();
+    as_object* pkg = createObject(gl);
     
     string_table& st = getStringTable(fn);
 
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index d6fd368..487a709 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -2515,7 +2515,7 @@ ActionInitObject(ActionExec& thread)
 
     // TODO: see if this could call the ASnative function(101, 9).
     Global_as& gl = getGlobal(env);
-    as_object* obj = gl.createObject();
+    as_object* obj = createObject(gl);
 
     obj->init_member(NSV::PROP_CONSTRUCTOR, getMember(gl, NSV::CLASS_OBJECT));
 
@@ -3284,7 +3284,7 @@ ActionDefineFunction2(ActionExec& thread)
             thread.getScopeStack());
 
     // We're stuck initializing our own prototype at the moment.
-    as_object* proto = getGlobal(env).createObject();
+    as_object* proto = createObject(getGlobal(env));
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
        func->init_member(NSV::PROP_CONSTRUCTOR,
@@ -3509,7 +3509,7 @@ ActionDefineFunction(ActionExec& thread)
             thread.getScopeStack());
     
     // We're stuck initializing our own prototype at the moment.
-    as_object* proto = getGlobal(env).createObject();
+    as_object* proto = createObject(getGlobal(env));
     proto->init_member(NSV::PROP_CONSTRUCTOR, func); 
     func->init_member(NSV::PROP_PROTOTYPE, proto);
        func->init_member(NSV::PROP_CONSTRUCTOR,
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 1ac1589..135cf9f 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -38,7 +38,6 @@
 #include "movie_definition.h"
 #include "Movie.h"
 #include "movie_root.h"
-#include "Globals.h"
 #include "Global_as.h"
 #include "rc.h" 
 #include "namedStrings.h"
@@ -65,7 +64,7 @@ VM::init(int version, movie_root& root, VirtualClock& clock)
        assert(_singleton.get());
        NSV::loadStrings(_singleton->_stringTable);
 
-    AVM1Global* gl(new AVM1Global(*_singleton));
+    Global_as* gl(new Global_as(*_singleton));
 
        _singleton->setGlobal(gl);
     gl->registerClasses();
diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index 322e920..7d673fd 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -75,8 +75,8 @@ main(int /*argc*/, char** /*argv*/)
     MovieClip* root = const_cast<Movie*>(&stage.getRootMovie());
     
     // just a couple of DisplayObjects
-    as_object* ob1 = getGlobal(*getObject(root)).createObject();
-    as_object* ob2 = getGlobal(*getObject(root)).createObject();
+    as_object* ob1 = createObject(getGlobal(*getObject(root)));
+    as_object* ob2 = createObject(getGlobal(*getObject(root)));
     
     boost::intrusive_ptr<DisplayObject> ch1 ( new DummyCharacter(ob1, root) );
     boost::intrusive_ptr<DisplayObject> ch2 ( new DummyCharacter(ob2, root) );

-----------------------------------------------------------------------

Summary of changes:
 doc/C/preformatted/gnash_ref.info.in               |    2 +-
 doc/C/preformatted/gnashref.html.in                |    2 +-
 doc/C/refmanual/extensions/extensions.xml          |    2 +-
 extensions/dbus/dbus_ext.cpp                       |    2 +-
 extensions/dejagnu/dejagnu.cpp                     |    2 +-
 extensions/fileio/fileio.cpp                       |    2 +-
 extensions/lirc/lirc_ext.cpp                       |    2 +-
 extensions/mysql/mysql_db.cpp                      |    2 +-
 libcore/AMFConverter.cpp                           |    2 +-
 libcore/Button.cpp                                 |    2 +-
 libcore/ClassHierarchy.h                           |   24 +---
 libcore/ExternalInterface.cpp                      |    1 -
 libcore/Video.cpp                                  |    2 +-
 libcore/as_function.cpp                            |   81 +++----------
 libcore/as_function.h                              |   24 ++--
 libcore/as_object.cpp                              |    4 +-
 libcore/as_object.h                                |    2 +-
 libcore/asobj/Accessibility_as.cpp                 |    2 +-
 libcore/asobj/Array_as.cpp                         |    2 +-
 libcore/asobj/Boolean_as.cpp                       |    2 +-
 libcore/asobj/Camera_as.cpp                        |    2 +-
 libcore/asobj/Color_as.cpp                         |    2 +-
 libcore/asobj/ContextMenu_as.cpp                   |    4 +-
 libcore/asobj/Date_as.cpp                          |    2 +-
 libcore/asobj/{Globals.cpp => Global_as.cpp}       |   94 +++++++++------
 libcore/asobj/Global_as.h                          |   95 +++++++---------
 libcore/asobj/Globals.h                            |  122 --------------------
 libcore/asobj/Microphone_as.cpp                    |    2 +-
 libcore/asobj/MovieClipLoader.cpp                  |    2 +-
 libcore/asobj/MovieClip_as.cpp                     |    2 +-
 libcore/asobj/NetConnection_as.cpp                 |    2 +-
 libcore/asobj/NetStream_as.cpp                     |    2 +-
 libcore/asobj/Number_as.cpp                        |    8 +-
 libcore/asobj/Object.cpp                           |    7 +-
 libcore/asobj/SharedObject_as.cpp                  |    4 +-
 libcore/asobj/Sound_as.cpp                         |    2 +-
 libcore/asobj/String_as.cpp                        |    2 +-
 libcore/asobj/TextField_as.cpp                     |    2 +-
 libcore/asobj/TextFormat_as.cpp                    |    2 +-
 libcore/asobj/XMLNode_as.cpp                       |    4 +-
 libcore/asobj/flash.am                             |    3 +-
 libcore/asobj/flash/display/BitmapData_as.cpp      |    6 +-
 libcore/asobj/flash/display/display_pkg.cpp        |    2 +-
 .../asobj/flash/external/ExternalInterface_as.cpp  |    3 +-
 libcore/asobj/flash/external/external_pkg.cpp      |    2 +-
 libcore/asobj/flash/filters/BitmapFilter_as.cpp    |    4 +-
 libcore/asobj/flash/filters/filters_pkg.cpp        |    2 +-
 libcore/asobj/flash/flash_pkg.cpp                  |    2 +-
 libcore/asobj/flash/geom/ColorTransform_as.cpp     |    2 +-
 libcore/asobj/flash/geom/Matrix_as.cpp             |    2 +-
 libcore/asobj/flash/geom/Point_as.cpp              |    2 +-
 libcore/asobj/flash/geom/Rectangle_as.cpp          |    2 +-
 libcore/asobj/flash/geom/Transform_as.cpp          |    2 +-
 libcore/asobj/flash/geom/geom_pkg.cpp              |    2 +-
 libcore/asobj/flash/net/net_pkg.cpp                |    2 +-
 libcore/asobj/flash/text/text_pkg.cpp              |    2 +-
 libcore/vm/ASHandlers.cpp                          |   32 ++++--
 libcore/vm/ExecutableCode.h                        |    3 +-
 libcore/vm/VM.cpp                                  |   21 ++--
 libcore/vm/VM.h                                    |   22 ----
 testsuite/actionscript.all/Function.as             |   24 ++--
 testsuite/libcore.all/DisplayListTest.cpp          |    4 +-
 62 files changed, 250 insertions(+), 422 deletions(-)
 rename libcore/asobj/{Globals.cpp => Global_as.cpp} (95%)
 delete mode 100644 libcore/asobj/Globals.h


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]