patchGnash - The GNU Flash player - Patches: patch #8933, Patch to use `_global` as a...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8933: Patch to use `_global` as a fallback `this` object in ExternalInterface callback

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Sun 06 Mar 2016 05:43:37 PM UTC
   
 
Category:  core Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  strk Open/Closed:  Closed

Tue 29 Mar 2016 10:29:59 AM UTC, comment #4: 

Redundancy is not a problem when applied to tests.
Patch 2 of 2 pushed as 29199b445b4a9315a1ae1006695f93a562592311
Thanks!

Sandro Santilli <strk>
Group Member
Wed 09 Mar 2016 06:09:44 AM UTC, comment #3: 

Patch 2 of 2:
See the attached `0008_add-external-interface-global-instance-fallback-prop-assignment-test.patch`.

This patch adds few more checks on relationship of `this` pointer inside
ExternalInterface callback registered with `null`/`undefined` context
and the `_global` object; by trying to assign a string member to it.
If the member could be accessed later via `_global` object: PASS, otherwise: FAIL.

(It is the same check as ones provided in `js2flash-nothis-v2.html` test)

Might need a review, since I'm not sure if this kind of property assignment
checks are redundant or not, as the previously-added strict equality test
should already check that `this` and `_global` are the same object instance
(provided that the operator works correctly on Gnash).


(file #36574)

Nutchanon Wetchasit <nachanon>
Mon 07 Mar 2016 12:28:34 PM UTC, comment #2: 

The forementioned bug in Gnash's `Function.call()` is now filed as bug #47354.

Nutchanon Wetchasit <nachanon>
Mon 07 Mar 2016 10:07:17 AM UTC, comment #1: 

Patch 1 aka 0007_supply-global-instance-for-externalinterface-callback.patch pushed as
commit 8b336929d19917a4d85629e8a9cd8483ad7f1c60

Sandro Santilli <strk>
Group Member
Sun 06 Mar 2016 05:43:37 PM UTC, original submission:  

This is a follow-up to patch #8840.

On current version of Gnash, when ExternalInterface callback which
registered with `undefined` or `null` as `instance` object get called,
`this` pointer inside the callback will be set to `null`.

On Flash Player, `this` instance inside the callback in this case would be
the same as one seen in a function invoked using `Function.call(null)` or `Function.call(undefined)`,
which is the `_global` object.

Patch 1 of 2:
See the attached `0007_supply-global-instance-for-externalinterface-callback.patch`.

This patch adds a provision to provide `_global` object as `this` instance
in the same manner as `Function.call(null)` and `Function.call(undefined)`
when the callback is registered without one; fixing this aspect of bug #37223.

Note: Implementation provided by this patch is not exactly the same as
current Gnash's `Function.call()`, as Gnash's `Function.call()` implementation
has a bug. Automated test of this particular case will follows.

Gnash: 0.8.11dev (patched against git 9229f6f 3-Mar-2016)
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #36574:  0008_add-external-interface-global-instance-fallback-prop-assignment-test.patch added by nachanon (3KiB - text/x-diff - Patch to add automated property assignment tests in null/undefined-context ExternalInterface callback)
file #36559:  0007_supply-global-instance-for-externalinterface-callback.patch added by nachanon (3KiB - text/x-diff - Patch to use `_global` as ExternalInterface callback context to the ones lacking it)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-29 strk StatusIn Progress Done
        Open/ClosedOpen Closed
    2016-03-09 nachanon Attached File- Added 0008_add-external-interface-global-instance-fallback-prop-assignment-test.patch, #36574
    2016-03-07 strk StatusNone In Progress
        Assigned toNone strk
    2016-03-06 nachanon Attached File- Added 0007_supply-global-instance-for-externalinterface-callback.patch, #36559

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code