From fb723a53a71efa1462457ce6c0e202b79fa42593 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Tue, 22 Jul 2014 12:43:23 -0400 Subject: [PATCH] Bug 1041237 - The bitmask enums flags calculation for getBitToEnumValue is flawed, r=jsantell --- .../canvasdebugger/test/browser_canvas-actor-test-09.js | 5 +++++ browser/devtools/canvasdebugger/test/doc_webgl-enum.html | 1 + toolkit/devtools/server/actors/call-watcher.js | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/browser/devtools/canvasdebugger/test/browser_canvas-actor-test-09.js b/browser/devtools/canvasdebugger/test/browser_canvas-actor-test-09.js index 229f3618bc83..8a8e0883409f 100644 --- a/browser/devtools/canvasdebugger/test/browser_canvas-actor-test-09.js +++ b/browser/devtools/canvasdebugger/test/browser_canvas-actor-test-09.js @@ -26,6 +26,11 @@ function ifTestingSupported() { is(functionCalls[0].argsPreview, "DEPTH_BUFFER_BIT | STENCIL_BUFFER_BIT | COLOR_BUFFER_BIT", "The bits passed into `gl.clear` have been cast to their enum values."); + is(functionCalls[1].name, "bindTexture", + "The function's name is correct."); + is(functionCalls[1].argsPreview, "TEXTURE_2D, null", + "The bits passed into `gl.bindTexture` have been cast to their enum values."); + yield removeTab(target.tab); finish(); } diff --git a/browser/devtools/canvasdebugger/test/doc_webgl-enum.html b/browser/devtools/canvasdebugger/test/doc_webgl-enum.html index 3c639363d508..f7f4d6d1e433 100644 --- a/browser/devtools/canvasdebugger/test/doc_webgl-enum.html +++ b/browser/devtools/canvasdebugger/test/doc_webgl-enum.html @@ -25,6 +25,7 @@ function drawScene() { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + gl.bindTexture(gl.TEXTURE_2D, null); window.requestAnimationFrame(drawScene); } diff --git a/toolkit/devtools/server/actors/call-watcher.js b/toolkit/devtools/server/actors/call-watcher.js index e9c902400f28..fb07b6368b29 100644 --- a/toolkit/devtools/server/actors/call-watcher.js +++ b/toolkit/devtools/server/actors/call-watcher.js @@ -210,9 +210,12 @@ let FunctionCallActor = protocol.ActorClass({ // XXX: All of this sucks. Make this smarter, so that the frontend // can inspect each argument, be it object or primitive. Bug 978960. let serializeArgs = () => args.map((arg, i) => { - if (typeof arg == "undefined") { + if (arg === undefined) { return "undefined"; } + if (arg === null) { + return "null"; + } if (typeof arg == "function") { return "Function"; } @@ -643,7 +646,7 @@ CallWatcherFront.ENUM_METHODS[CallWatcherFront.CANVAS_WEBGL_CONTEXT] = { * For example, when gl.clear(gl.COLOR_BUFFER_BIT) is called, the actual passed * argument's value is 16384, which we want identified as "COLOR_BUFFER_BIT". */ -var gEnumRegex = /^[A-Z_]+$/; +var gEnumRegex = /^[A-Z][A-Z0-9_]+$/; var gEnumsLookupTable = {}; // These values are returned from errors, or empty values,