todo
- received first by the OS
- then by websocket server code we don't control
- eventually handed over to us
- we parse the message enough to figure out the topic
| import unicodedata | |
| # Unique value meaning "not finished parsing" | |
| class TimedOut: | |
| def __repr__(self): return "TimedOut" | |
| TimedOut = TimedOut() | |
| BASIC_ESCAPES = { |
| function SaferHTML(templateData) { | |
| var s = templateData[0]; | |
| for (var i = 1; i < arguments.length; i++) { | |
| var arg = String(arguments[i]); | |
| // Escape special characters in the substitution. | |
| s += arg.replace(/&/g, "&") | |
| .replace(/</g, "<") | |
| .replace(/>/g, ">"); |
| use serde::Deserialize; | |
| use actix_web::{web, App, HttpResponse, HttpServer}; | |
| fn gcd(mut n: u64, mut m: u64) -> u64 { | |
| assert!(n != 0 && m != 0); | |
| while m != 0 { | |
| if m < n { | |
| let t = m; | |
| m = n; | |
| n = t; |
| // Taken from http://dxr.mozilla.org/mozilla-central/source/js/xpconnect/tests/chrome/test_xrayToJS.xul | |
| ... | |
| // Test constructors that can be instantiated with zero arguments. | |
| for (var c of simpleConstructors) { | |
| ok(iwin[c], "Constructors appear: " + c); | |
| is(iwin[c], Cu.unwaiveXrays(iwin.wrappedJSObject[c]), | |
| "we end up with the appropriate constructor: " + c); | |
| is(Cu.unwaiveXrays(Cu.waiveXrays(new iwin[c]).constructor), iwin[c], |
| Before: | |
| // Test constructors that can be instantiated with zero arguments. | |
| for (var c of simpleConstructors) { | |
| ok(iwin[c], "Constructors appear: " + c); | |
| is(iwin[c], Cu.unwaiveXrays(iwin.wrappedJSObject[c]), | |
| "we end up with the appropriate constructor: " + c); | |
| is(Cu.unwaiveXrays(Cu.waiveXrays(new iwin[c]).constructor), iwin[c], | |
| "constructor property is set up right: " + c); | |
| let expectedProto = /Opaque/.test(new iwin[c]) ? iwin['Object'].prototype |
| On Tue, Apr 7, 2015 at 4:54 PM, Brendan Eich <brendan@mozilla.org> wrote: | |
| > BT: we found several sites that are broken by the new function.name | |
| > algorithm. [...] | |
| > | |
| > [...] | |
| > | |
| > ARB: which is one of these webpages? | |
| > | |
| > BT: cheezburger.com, the comments won't load. | |
| > |
| for (VAR of ITERABLE) | |
| STATEMENT | |
| ---- | |
| var $iterator = (ITERABLE)[Symbol.iterator](); | |
| var $skipReturn; | |
| try { | |
| while (true) { | |
| $skipReturn = true; |
| // *** Before ***************************************************************** | |
| // The program operated on a large document tree (DOM-like, but not exactly DOM). | |
| // It had several functions that needed to walk the entire tree, | |
| // which was done with recursion, like this: | |
| function stripGrammar(doc) { | |
| ... | |
| function visit(parent) { | |
| for (var [i, child] of parent.content.entries()) { | |
| if (typeof child === "object") { |