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. 8dccca727e76caefd516


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 8dccca727e76caefd516adfa04e2f0c98c76fdbd
Date: Fri, 29 Oct 2010 13:07:49 +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  8dccca727e76caefd516adfa04e2f0c98c76fdbd (commit)
       via  ddac7061e34dc03fea183d770ab75ee5a3b73f9a (commit)
       via  d0f9450b950a04cc1ff60357e4db1962e3a74599 (commit)
       via  4231d76297c8ef53a303f3020475b85f2c048d2d (commit)
       via  e870dfa6132eeca9c9a31efab19e009637fdaae8 (commit)
      from  055954855abcbc4462dd4aeb9fb92ea1cba7d255 (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=8dccca727e76caefd516adfa04e2f0c98c76fdbd


commit 8dccca727e76caefd516adfa04e2f0c98c76fdbd
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 29 14:59:41 2010 +0200

    Add test that reproduces the bug fixed in previous commit.

diff --git a/testsuite/actionscript.all/Object.as 
b/testsuite/actionscript.all/Object.as
index 55273c2..72bed44 100644
--- a/testsuite/actionscript.all/Object.as
+++ b/testsuite/actionscript.all/Object.as
@@ -979,6 +979,21 @@ check(nonk.__proto__);
 check(!nonk._width);
 check(nonk.__proto__._width);
 
+// Check that running Object's constructor doesn't change __proto__.
+// This was only because we were doing something stupid before.
+
+I = function() {
+    check_equals(this.__proto__.toString(), "orig");
+    super();
+    check_equals(this.__proto__.toString(), "orig");
+};
+
+o = new Object();
+I.prototype = o;
+I.prototype.toString = function() { return "orig"; };
+
+var tmp = new I();
+
 ////////////////////////////////
 
 // Messing about here with global classes may ruin later tests, so don't add
@@ -1011,10 +1026,10 @@ o = new Object(b);
 check_equals(typeof(o), "undefined");
 
 #if OUTPUT_VERSION <= 5
-totals(137);
+totals(139);
 #endif
 
 #if OUTPUT_VERSION >= 6
-totals(325);
+totals(327);
 #endif
 

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


commit ddac7061e34dc03fea183d770ab75ee5a3b73f9a
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 29 14:48:36 2010 +0200

    Don't touch the prototype in Object's constructor; everything
    necessary has already been done.

diff --git a/libcore/asobj/Object.cpp b/libcore/asobj/Object.cpp
index f4b00b8..f4329cc 100644
--- a/libcore/asobj/Object.cpp
+++ b/libcore/asobj/Object.cpp
@@ -138,10 +138,8 @@ attachObjectInterface(as_object& o)
 as_value
 object_ctor(const fn_call& fn)
 {
-    log_debug("Object ctor");
 
     if (fn.nargs == 1) {
-        log_debug("Conversion ctor");
         as_object* obj = toObject(fn.arg(0), getVM(fn));
         if (obj) return as_value(obj);
     }
@@ -158,10 +156,6 @@ object_ctor(const fn_call& fn)
         return new as_object(gl);
     }
 
-    if (fn.this_ptr) {
-        gl.makeObject(*fn.this_ptr);
-    }
-
     return as_value();
 
 }

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


commit d0f9450b950a04cc1ff60357e4db1962e3a74599
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 29 14:48:16 2010 +0200

    Minor cleanup.

diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index 4ce58c1..e371ec5 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -1412,17 +1412,15 @@ array_new(const fn_call& fn)
 
     ao->setRelay(0);
     ao->setArray();
-
     ao->init_member(NSV::PROP_LENGTH, 0.0);
 
-    if (fn.nargs == 0) {
+    if (!fn.nargs) {
         return as_value(ao);
     }
 
     if (fn.nargs == 1 && fn.arg(0).is_number()) {
-        int newSize = toInt(fn.arg(0), getVM(fn));
-        if (newSize < 0) newSize = 0;
-        else {
+        const int newSize = std::max(toInt(fn.arg(0), getVM(fn)), 0);
+        if (newSize) {
             ao->set_member(NSV::PROP_LENGTH, newSize);
         }
         return as_value(ao);
@@ -1432,7 +1430,6 @@ array_new(const fn_call& fn)
     for (size_t i = 0; i < fn.nargs; i++) {
         callMethod(ao, NSV::PROP_PUSH, fn.arg(i));
     }
-    
 
     return as_value(ao);
 }

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


commit 4231d76297c8ef53a303f3020475b85f2c048d2d
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 29 14:25:27 2010 +0200

    Drop another incorrect isInstantiation() use.

diff --git a/libcore/asobj/LoadVars_as.cpp b/libcore/asobj/LoadVars_as.cpp
index bbfda6b..2e172a7 100644
--- a/libcore/asobj/LoadVars_as.cpp
+++ b/libcore/asobj/LoadVars_as.cpp
@@ -150,8 +150,6 @@ as_value
 loadvars_ctor(const fn_call& fn)
 {
 
-    if (!fn.isInstantiation()) return as_value();
-
     IF_VERBOSE_ASCODING_ERRORS(
         if (fn.nargs) {
             std::ostringstream ss;

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


commit e870dfa6132eeca9c9a31efab19e009637fdaae8
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 29 14:23:58 2010 +0200

    Drop incorrect isInstantiation use.

diff --git a/libcore/asobj/Error_as.cpp b/libcore/asobj/Error_as.cpp
index 19096a4..9a3f21c 100644
--- a/libcore/asobj/Error_as.cpp
+++ b/libcore/asobj/Error_as.cpp
@@ -79,14 +79,12 @@ error_toString(const fn_call& fn)
 as_value
 error_ctor(const fn_call& fn)
 {
-
-    if (!fn.isInstantiation()) return as_value();
-
     as_object* err = fn.this_ptr;
+    if (!err) return as_value();
 
     string_table& st = getStringTable(fn);
 
-    if (fn.nargs) {
+    if (fn.nargs && !fn.arg(0).is_undefined()) {
                err->set_member(st.find("message"), fn.arg(0));
        }
 
diff --git a/libcore/asobj/Object.cpp b/libcore/asobj/Object.cpp
index 629717d..f4b00b8 100644
--- a/libcore/asobj/Object.cpp
+++ b/libcore/asobj/Object.cpp
@@ -138,7 +138,10 @@ attachObjectInterface(as_object& o)
 as_value
 object_ctor(const fn_call& fn)
 {
+    log_debug("Object ctor");
+
     if (fn.nargs == 1) {
+        log_debug("Conversion ctor");
         as_object* obj = toObject(fn.arg(0), getVM(fn));
         if (obj) return as_value(obj);
     }

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

Summary of changes:
 libcore/asobj/Array_as.cpp           |    9 +++------
 libcore/asobj/Error_as.cpp           |    6 ++----
 libcore/asobj/LoadVars_as.cpp        |    2 --
 libcore/asobj/Object.cpp             |    5 +----
 testsuite/actionscript.all/Object.as |   19 +++++++++++++++++--
 5 files changed, 23 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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