SpiderMonkey:
> 0++;
SyntaxError: invalid increment operand
V8:
XPCOMUtils.defineLazyGetter(DebuggerController, "_isRemoteDebugger", function() { | |
// We're inside a single top level XUL window, not an iframe container. | |
return !(window.frameElement instanceof XULElement) && | |
!!window._remoteFlag; | |
}); | |
XPCOMUtils.defineLazyGetter(DebuggerController, "_isChromeDebugger", function() { | |
// We're inside a single top level XUL window, but not a remote debugger. | |
return !(window.frameElement instanceof XULElement) && | |
!window._remoteFlag; |
/** | |
* notabs.js | |
* | |
* A reporter that discards all warnings about mixed tabs and errors. | |
* This file was based on our default reporter so output is the same. | |
* | |
* Usage: | |
* jshint myfile.js --reporter=notabs.js | |
*/ |
function PC_start() { | |
// Also available: gc, stackwalk, jank, adb, copyProfileOnStop | |
let features = ["js"]; | |
this.entries = 1000000; | |
this.interval = 1; | |
this.profiler.StartProfiler(this.entries, this.interval, features, features.length); | |
dump("[LOG] features: " + this.profiler.GetFeatures([]) + "\n"); // [LOG] features: stackwalk,jank,js | |
} |
SpiderMonkey:
> 0++;
SyntaxError: invalid increment operand
V8:
var hasWorkingNestedRedirectedCalls = (function () { | |
function f(a) { return function() { return a.apply(this, arguments); }} | |
var g1 = f(function(a) { return a; }); | |
var g2 = new g1(g1); | |
return typeof g2 == "function"; | |
})(); |
var Lounge = Backbone.View.extend({ | |
initialize: function (options) { | |
// ... | |
Bus.listen('window.inViewport', () => { | |
this.states.inViewport = true; | |
this.trigger('inViewport'); | |
}); | |
Bus.listen('window.scrollOffViewport', () => { |
Object.defineProperty(Object.prototype, "foo", { | |
set: function (v) { | |
console.log("hello:", v); | |
}, | |
configurable: true} | |
); | |
var obj = { foo: "bar" }; | |
var obj2 = {}; |
I started writing this program but then got bored and decided to | |
re-write it in Go. This is my unfinished JavaScript variant. | |
See https://github.com/antonkovalyov/r2go for more information. |
Array.prototype.join = function () { | |
return "LOL, UMAD?"; | |
}; | |
(function () { | |
"use built-ins"; | |
console.log(['Hello', 'World'].join(', ')); // Hello, World | |
}()); |
package main | |
import ( | |
"template" | |
"fmt" | |
) | |
func main() { | |
tmpl := template.New(nil) | |
tmpl.SetDelims("{{", "}}") |