Created
December 7, 2014 20:02
-
-
Save vladima/13656a650d330da74951 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Windows.Forms; | |
namespace ConsoleApplication | |
{ | |
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
var browser = new WebBrowser { ScriptErrorsSuppressed = true }; | |
browser.Navigate(""); | |
dynamic window = browser.Document.Window.DomWindow; | |
window.execScript("function foo() { }; foo.prototype.run = function() { return 10; };function bar() { return new foo(); }"); | |
var z = ((dynamic)window.bar()).run(); // will crash here | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment