Bug 1065185 - Fix devtools actors. r=bz

See browser/devtools/canvasdebugger/test/browser_canvas-actor-test-02.js.
And note that we need to re-waive the result, otherwise we get failures in
browser/devtools/canvasdebugger/test/browser_canvas-actor-test-10.js.

See browser/devtools/shadereditor/test/browser_se_editors-contents.js for the
webgls stuff.
This commit is contained in:
Bobby Holley 2014-10-03 10:05:50 +02:00
Родитель fe8430e115
Коммит 6d92895a99
2 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -412,11 +412,13 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* Instruments a function on the specified target object.
*/
function overrideFunction(global, target, name, descriptor, callback) {
let originalFunc = target[name];
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let originalFunc = Cu.unwaiveXrays(target[name]);
Object.defineProperty(target, name, {
value: function(...args) {
let result = originalFunc.apply(this, args);
let result = Cu.waiveXrays(originalFunc.apply(this, args));
if (self._recording) {
let stack = getStack(name);
@ -435,13 +437,15 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* Instruments a getter or setter on the specified target object.
*/
function overrideAccessor(global, target, name, descriptor, callback) {
let originalGetter = target.__lookupGetter__(name);
let originalSetter = target.__lookupSetter__(name);
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let originalGetter = Cu.unwaiveXrays(target.__lookupGetter__(name));
let originalSetter = Cu.unwaiveXrays(target.__lookupSetter__(name));
Object.defineProperty(target, name, {
get: function(...args) {
if (!originalGetter) return undefined;
let result = originalGetter.apply(this, args);
let result = Cu.waiveXrays(originalGetter.apply(this, args));
if (self._recording) {
let stack = getStack(name);

Просмотреть файл

@ -492,7 +492,9 @@ let WebGLInstrumenter = {
if (glBreak) return undefined;
}
let glResult = originalFunc.apply(this, glArgs);
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let glResult = Cu.waiveXrays(Cu.unwaiveXrays(originalFunc).apply(this, glArgs));
if (timing >= 0 && !observer.suppressHandlers) {
let glBreak = observer[afterFuncName](glArgs, glResult, cache, proxy);