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. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-226-g9ebb838
Date: Sat, 09 Apr 2011 10:04:19 +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  9ebb838ff18a926b21f4dcd36ddabaab637a37e4 (commit)
       via  ed248229c698f3a086c67935fe1e7fcee1cc0758 (commit)
      from  10b00498541cf75294e7e7cf3258b6865e8b009c (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=9ebb838ff18a926b21f4dcd36ddabaab637a37e4


commit 9ebb838ff18a926b21f4dcd36ddabaab637a37e4
Author: Benjamin Wolsey <address@hidden>
Date:   Sat Apr 9 11:50:57 2011 +0200

    Test and correct case-insensitivity.
    
    Test that _global is case insensitive in SWF 6 (as already implemented).
    Test that this is case insensitive in SWF 5 and 6; correct
    implementation.

diff --git a/libcore/as_environment.cpp b/libcore/as_environment.cpp
index 526bb9f..9fef1de 100644
--- a/libcore/as_environment.cpp
+++ b/libcore/as_environment.cpp
@@ -532,17 +532,20 @@ getVariableRaw(const as_environment& env, const 
std::string& varname,
         }
     }
 
-    // Looking for "this"  (TODO: add NSV::PROP_THIS)
-    if (varname == "this") {
+    // AS1 has neither "this" nor any global object.
+    if (swfVersion < 5) return as_value();
+
+    const ObjectURI::CaseEquals eq(getVM(env).getStringTable(),
+            swfVersion < 7);
+
+    // Looking for "this" 
+    if (eq(key, NSV::PROP_THIS)) {
         val.set_as_object(getObject(env.get_original_target()));
-        if (retTarget) *retTarget = NULL; // correct ??
+        if (retTarget) *retTarget = NULL; 
         return val;
     }
 
     as_object* global = vm.getGlobal();
-
-    // TODO: check if we really want case-sensitive comparison
-    ObjectURI::CaseEquals eq(getVM(env).getStringTable());
     if (swfVersion > 5 && eq(key, NSV::PROP_uGLOBAL)) {
 #ifdef GNASH_DEBUG_GET_VARIABLE
         log_debug("Took %s as _global, returning _global", varname);
@@ -553,7 +556,7 @@ getVariableRaw(const as_environment& env, const 
std::string& varname,
     }
 
     // Version 4 only has local variables.
-    if (swfVersion > 4 && global->get_member(key, &val)) {
+    if (global->get_member(key, &val)) {
 #ifdef GNASH_DEBUG_GET_VARIABLE
         log_debug("Found %s in _global", varname);
 #endif
diff --git a/testsuite/actionscript.all/Global.as 
b/testsuite/actionscript.all/Global.as
index 4ddfee5..1d512b6 100644
--- a/testsuite/actionscript.all/Global.as
+++ b/testsuite/actionscript.all/Global.as
@@ -26,6 +26,26 @@
 rcsid="$Id: Global.as,v 1.51 2008/03/31 23:48:33 strk Exp $";
 #include "check.as"
 
+#if OUTPUT_VERSION < 6
+ check_equals(typeof(_global), "undefined");
+#endif
+
+#if OUTPUT_VERSION == 6
+ check_equals(typeof(_gLobal), "object");
+ check_equals(typeof(_gLobal), "object");
+ check_equals(typeof(_GLOBAL), "object");
+ check_equals(_GLOBAL, _global);
+ check_equals(_GlOBAL, _global);
+#endif
+
+#if OUTPUT_VERSION < 7
+ check_equals(this.toString(), "[object Object]");
+ check_equals(thIs.toString(), "[object Object]");
+ check_equals("" + this, "_level0");
+ check_equals(this, This);
+ check_equals(this, THIS);
+#endif
+
 check_equals(typeof(Button), 'function'); // random check
 
 // Check that CustomActions isn't recognized by the player.
@@ -506,10 +526,10 @@ check_equals(r, "l,j,k,");
 
 
 #if OUTPUT_VERSION == 5
-       check_totals(159); // SWF5
+       check_totals(165); // SWF5
 #else
 # if OUTPUT_VERSION == 6
-       check_totals(193); // SWF6
+       check_totals(203); // SWF6
 # else
 #  if OUTPUT_VERSION == 7
        check_totals(175); // SWF7

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


commit ed248229c698f3a086c67935fe1e7fcee1cc0758
Author: Benjamin Wolsey <address@hidden>
Date:   Sat Apr 9 11:13:25 2011 +0200

    Make number tests pass.
    
    Use magic numbers like the pp does for cross-platform consistency.

diff --git a/libcore/asobj/Number_as.cpp b/libcore/asobj/Number_as.cpp
index ef768d2..9416191 100644
--- a/libcore/asobj/Number_as.cpp
+++ b/libcore/asobj/Number_as.cpp
@@ -130,10 +130,10 @@ attachNumberStaticInterface(as_object& o)
     as_value null; null.set_null();
     o.setPropFlags(null, 0, cflags);
 
-    o.init_member("MAX_VALUE",
-            std::numeric_limits<double>::max(), cflags);
-    o.init_member("MIN_VALUE",
-            std::numeric_limits<double>::denorm_min(), cflags);
+    // Not quite the same as numeric_limits<double>::max()
+    o.init_member("MAX_VALUE", 1.79769313486231e+308, cflags);
+    // This is generally numeric_limits<double>::denorm_min().
+    o.init_member("MIN_VALUE", 4.94065645841247e-324, cflags);
     o.init_member("NaN", as_value(NaN), cflags);
     o.init_member("POSITIVE_INFINITY",
             as_value(std::numeric_limits<double>::infinity()), cflags);
diff --git a/testsuite/actionscript.all/Number.as 
b/testsuite/actionscript.all/Number.as
index 1930dfd..efdce9e 100644
--- a/testsuite/actionscript.all/Number.as
+++ b/testsuite/actionscript.all/Number.as
@@ -38,7 +38,7 @@ check(Number.hasOwnProperty('MAX_VALUE'));
 check_equals(typeof(Number.MAX_VALUE), "number");
 // gnash fails in rounding (ends in 2316, we round up to 232)
 // TODO: check that we're close, if not extremely accurate
-xcheck_equals(Number.MAX_VALUE.toString(), "1.79769313486231e+308");
+check_equals(Number.MAX_VALUE.toString(), "1.79769313486231e+308");
 
 check(Number.hasOwnProperty('MIN_VALUE'));
 check_equals(typeof(Number.MIN_VALUE), "number");
diff --git a/testsuite/swfdec/PASSING b/testsuite/swfdec/PASSING
index bb7668d..89c754e 100644
--- a/testsuite/swfdec/PASSING
+++ b/testsuite/swfdec/PASSING
@@ -615,6 +615,7 @@ getvariable-dotdot-6.swf:becc7079e65bcf47fe2ab0293bbc2c29
 getvariable-dotdot-7.swf:efa5597fe3e61764b6ee937f87d8cf1b
 getvariable-dotdot-8.swf:2861d34a85b5de09f41af572e0b1a6a5
 getvariable-length-5.swf:2d07e2afdf45356cf2df5c1176ed29ad
+getvariable-scopechain-5.swf:d46305206debfb53bb70678c32d2c401
 getvariable-setvariable-5.swf:6bdb4be98bfd34cf5c37d237c13a732a
 getvariable-setvariable-6.swf:eec9c92f5871136bdc444595aa26dbb9
 getvariable-setvariable-7.swf:ca4ed5a192fde844558b9b1b91b48a03
@@ -874,6 +875,10 @@ number-construct-5.swf:088dba71e4cd7a40af90e5e9d587d37d
 number-construct-6.swf:dcc593e3aa5895ba1afb3aacbaf0b6a0
 number-construct-7.swf:983a9fd7016e14aa58b03cd0b4f4cf08
 number-construct-8.swf:cded06557be37197e945a29fd09e0b0f
+number-properties-5.swf:33792346ad69c8f74699480a0183bd03
+number-properties-6.swf:ab737b0ba11b14f15c8784005dcc71b0
+number-properties-7.swf:6faeb469033c0d0310f0d982740ef1b0
+number-properties-8.swf:5d88f881c8b6f3f6e10a244301fcafed
 number.swf:3ef5211bf02f128749453b0ea006061d
 number-tostring-radix-5.swf:9c620b9523efbfc2cd30832d38c3d403
 number-tostring-radix-6.swf:82b91ba51d982a8c27dddffd129051df

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

Summary of changes:
 libcore/as_environment.cpp           |   17 ++++++++++-------
 libcore/asobj/Number_as.cpp          |    8 ++++----
 testsuite/actionscript.all/Global.as |   24 ++++++++++++++++++++++--
 testsuite/actionscript.all/Number.as |    2 +-
 testsuite/swfdec/PASSING             |    5 +++++
 5 files changed, 42 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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