Skip to content

Instantly share code, notes, and snippets.

View evilpie's full-sized avatar

Tom Schuster evilpie

View GitHub Profile
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyArrayLength.js b/js/src/jit-test/tests/proxy/testDirectProxyArrayLength.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/proxy/testDirectProxyArrayLength.js
@@ -0,0 +1,4 @@
+var a = [1, 2, 3];
+var p = new Proxy(a, {});
+assertEq(p.length, 3);
+assertEq(JSON.stringify(p), "[1,2,3]");
diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp
# HG changeset patch
# Parent c6ae2f78d271f4bd87d8f0efb6086a8a624f0e4b
diff --git a/lib/contentPolicy.js b/lib/contentPolicy.js
--- a/lib/contentPolicy.js
+++ b/lib/contentPolicy.js
@@ -129,73 +129,92 @@ let Policy = exports.Policy =
Utils.styleService.loadAndRegisterSheet(collapseStyle, Ci.nsIStyleSheetService.USER_SHEET);
onShutdown.add(function()
{
@evilpie
evilpie / gist:2bc4e7f94483b36c6e76
Created December 12, 2014 23:05
Remove getEnumerablePropertyKeys
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -645,18 +645,16 @@ public:
JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
JS::MutableHandle<JSPropertyDescriptor> desc)
const MOZ_OVERRIDE;
virtual bool hasOwn(JSContext *cx, JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id, bool *bp) const MOZ_OVERRIDE;
diff --git a/dom/camera/DOMCameraCapabilities.cpp b/dom/camera/DOMCameraCapabilities.cpp
--- a/dom/camera/DOMCameraCapabilities.cpp
+++ b/dom/camera/DOMCameraCapabilities.cpp
@@ -165,31 +165,31 @@ DOMCameraCapabilities::StringListToNewOb
JS::MutableHandle<JS::Value> aArray,
uint32_t aKey)
{
JS::Rooted<JSObject*> array(aCx);
nsresult rv = ParameterListToNewArray(aCx, &array, aKey, ParseStringItemAndAdd);
diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h
--- a/content/base/public/nsDOMFile.h
+++ b/content/base/public/nsDOMFile.h
@@ -291,17 +291,17 @@ public:
// Lazily get the content type and size
mContentType.SetIsVoid(true);
mName.SetIsVoid(true);
}
// Overrides
function Q(s, f) {
var r = document.querySelectorAll(s), a = [ ];
[ ].slice.call(r).forEach(function(e, i) {
a[i] = e;
f && f(e);
});
return a;
}
function Q(s, f) {
@evilpie
evilpie / gist:4206951
Created December 4, 2012 18:03
Building SpiderMonkey x86 on x64
sudo apt-get install g++-multilib
CC='gcc -m32' CXX='g++ -m32' ../configure --target=i686-pc-linux
and eax, 0x33
and eax, 0x22
mov [ebx + 0x44], eax
mov [ebx + 0x40], 0x4
and [ebx + 0x44], 0x11 ; why postpone that?
; vs
and eax, 0x33
and eax, 0x22
and eax, 0x11
diff --git a/js/src/assembler/assembler/X86Assembler.h b/js/src/assembler/assembler/X86Assembler.h
--- a/js/src/assembler/assembler/X86Assembler.h
+++ b/js/src/assembler/assembler/X86Assembler.h
@@ -279,16 +279,17 @@ private:
OP2_ADDSD_VsdWsd = 0x58,
OP2_MULSD_VsdWsd = 0x59,
OP2_CVTSS2SD_VsdEd = 0x5A,
OP2_CVTSD2SS_VsdEd = 0x5A,
OP2_SUBSD_VsdWsd = 0x5C,
OP2_DIVSD_VsdWsd = 0x5E,
diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -1505,16 +1505,45 @@ CodeGenerator::visitStringLength(LString
Register output = ToRegister(lir->output());
masm.loadPtr(lengthAndFlags, output);
masm.rshiftPtr(Imm32(JSString::LENGTH_SHIFT), output);
return true;
}