-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Test RegExp toString behavior
- Loading branch information
Showing
4 changed files
with
39 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,28 @@ | ||
package { | ||
import flash.display.Sprite; | ||
public class Test extends Sprite { | ||
public function Test() { | ||
} | ||
} | ||
} | ||
|
||
var regexp = /abc/xsmig; | ||
|
||
trace("// trace(regexp)"); | ||
trace(regexp); | ||
|
||
trace("// regexp.toString()"); | ||
trace(regexp.toString()); | ||
|
||
trace("// RegExp.prototype.toString.call(regexp)"); | ||
trace(RegExp.prototype.toString.call(regexp)); | ||
|
||
trace("// Object.prototype.toString.call(regexp)"); | ||
trace(Object.prototype.toString.call(regexp)); | ||
|
||
trace("// RegExp.prototype.toString.call({})"); | ||
try { | ||
RegExp.prototype.toString.call({}); | ||
} catch (e) { | ||
trace(e); | ||
} |
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,10 @@ | ||
// trace(regexp) | ||
/abc/gimsx | ||
// regexp.toString() | ||
/abc/gimsx | ||
// RegExp.prototype.toString.call(regexp) | ||
/abc/gimsx | ||
// Object.prototype.toString.call(regexp) | ||
[object RegExp] | ||
// RegExp.prototype.toString.call({}) | ||
TypeError: Error #1034: Type Coercion failed: cannot convert Object@00000000000 to RegExp. |
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 |