summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html')
-rw-r--r--testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html b/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html
new file mode 100644
index 000000000..77a874690
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Interaction of setTimeout and WebIDL</title>
+<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout">
+<link rel="help" href="https://heycam.github.io/webidl/#es-operations">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test()
+function finishTest() {
+ assert_equals(log, "ONE TWO ")
+ t.done()
+}
+var log = '';
+function logger(s) { log += s + ' '; }
+
+setTimeout({ toString: function () {
+ setTimeout("logger('ONE')", 100);
+ return "logger('TWO'); t.step(finishTest)";
+} }, 100);
+</script>