Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: html/templates/test-bad-index.js

Issue 29331713: TEST ONLY -- Verify behavior of DISP_E_BADINDEX in the IE JavaScript runtime (Closed)
Patch Set: Created Dec. 1, 2015, 5:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « html/templates/test-bad-index.html ('k') | src/plugin/PluginUserSettings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/templates/test-bad-index.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/html/templates/test-bad-index.js
@@ -0,0 +1,43 @@
+function init()
+{
+ var errorElement = document.getElementById("errorMessage");
+ errorElement.innerHTML = "";
+ var settings;
+ try
+ {
+ settings = window.Settings;
+ }
+ catch (e)
+ {
+ errorElement.innerHTML = "Did not instantiate Settings object";
+ return;
+ }
+
+ var result1 = document.getElementById("result1");
+ try
+ {
+ settings.TestBadIndex(0);
+ result1.textContent = "Success";
+ }
+ catch (e)
+ {
+ result1.textContent = "Failure";
+ errorElement.innerHTML = "TestBadIndex(0) threw an exception, which is not the expected behavior";
+ return;
+ }
+
+ var result2 = document.getElementById("result2");
+ try
+ {
+ settings.TestBadIndex(1);
+ result2.textContent = "Failure";
+ errorElement.innerHTML = "TestBadIndex(1) did not throw an exception, which is not the expected behavior";
+ return;
+ }
+ catch (e)
+ {
+ result2.textContent = "Success";
+ indexException = document.getElementById("indexException");
+ indexException.innerHTML = "Index exception: message = " + e.message + ", prototype name = " + e.__proto__.name ;
+ }
+}
« no previous file with comments | « html/templates/test-bad-index.html ('k') | src/plugin/PluginUserSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld