forked from ruffle-rs/ruffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Test Proxy hasProperty override is called for hasOwnProperty
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package { | ||
import flash.display.Sprite; | ||
|
||
public class Test extends Sprite { | ||
public function Test() { | ||
var proxy: TestProxy = new TestProxy(); | ||
trace('// proxy["hasOwnProperty"](123)'); | ||
trace(proxy["hasOwnProperty"](123)); | ||
|
||
trace('// proxy.hasOwnProperty("foobar")'); | ||
trace(proxy.hasOwnProperty("foobar")); | ||
|
||
trace('// Object.prototype.hasOwnProperty.call(proxy, "hello world")'); | ||
trace(Object.prototype.hasOwnProperty.call(proxy, "hello world")); | ||
} | ||
} | ||
} | ||
|
||
import flash.utils.Proxy; | ||
import flash.utils.flash_proxy; | ||
|
||
dynamic class TestProxy extends Proxy { | ||
override flash_proxy function hasProperty(name:*):Boolean { | ||
trace("hasProperty: " + typeof name + " " + name); | ||
return name == "foobar"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// proxy["hasOwnProperty"](123) | ||
hasProperty: string 123 | ||
false | ||
// proxy.hasOwnProperty("foobar") | ||
hasProperty: string foobar | ||
true | ||
// Object.prototype.hasOwnProperty.call(proxy, "hello world") | ||
false |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |