Closed Bug 1071526 Opened 10 years ago Closed 7 years ago

Endless TypeErrors in atoms.js

Categories

(Remote Protocol :: Marionette, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gwagner, Unassigned)

Details

(Keywords: pi-marionette-server)

Attachments

(1 file)

When starting the phone with a debug gecko I get:

I/Gecko   ( 4771): 1411467232087	Marionette	INFO	marionette-server.js loaded
V/WLAN_PSA(  213): NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 19 column: 187 source: "ts.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function ha(a){return a.replac"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 32 column: 188 source: ""function"==typeof a.item}return l}function lb(a,b){for(var a=a.parentNode,c=0;a;){if(b(a))return a;a=a.parentNode;c++}r"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 34 column: 25 source: "function mb(a){var b=a.v,a="CSS1Compat"==b.compatMode?b.documentElement:b.body,b=b.pa"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 36 column: 1250 source: "=K.prototype;p.p=k;p.q=0;p.ha=l;function L(a,b,c,d){if(a.p=b)a.q="number"==typeof c?c:1!=a.p.nodeType?0:a.o?-1:1;"number"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 39 column: 77 source: "r(var b=D(a),c=vb(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=vb(a,"position"),"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 42 column: 425 source: "b[b]||b,d=a[c];if(!r(d)&&0<=A(Ab,c))return l;if(c="value"==b)if(c=M(a,"OPTION")){var e;c=b.toLowerCase();if(a.hasAttribu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 42 column: 444 source: "r(d)&&0<=A(Ab,c))return l;if(c="value"==b)if(c=M(a,"OPTION")){var e;c=b.toLowerCase();if(a.hasAttribute)e=a.hasAttribute"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 47 column: 290 source: "Ib(a);if(b&&"hidden"==Jb(b,"overflow")){var c=Lb(b),d=xb(b),a=xb(a);return d.x+c.width<a.x||d.y+c.height<a.y?l:e(b)}retu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 48 column: 145 source: "usemap = "#'+a.name+'"]',f):gb(f,function(b){var c;if(c=M(b))8==b.nodeType?b=k:(c="usemap","style"==c?(b=ha(b.style.cssT"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 56 column: 715 source: "d=function(a){this.n.set(kc(a),a)};p.aa=function(a){for(var a=gc(a),b=a.length,c=0;c<b;c++)this.add(a[c])};p.contains=fu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable c redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 62 column: 264 source: "teProfilerMark&&q.msWriteProfilerMark(b);for(b=this;b;){var c=b,d=a;if(c.ra)for(var e=0,f=h;f=c.ra[e];e++)f(d);b=b.getPa"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 65 column: 481 source: "unction Cc(a){if(a.getSelection)return a.getSelection();var a=a.document,b=a.selection;if(b){try{var c=b.createRange();i"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 68 column: 68 source: "tion(a,b){var c=F(D(this.b()));if(c=(c=Cc(c||window))&&Jc(c))var d=c.b(),e=c.g(),f=c.j(),j=c.k();var m=this.a.cloneRange"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 86 column: 86 source: "=c)return d<b;var e;if(1==a.nodeType&&b)if(e=a.childNodes[b])a=e,b=0;else if(G(a,c))return i;if(1==c.nodeType&&d)if(e=c."}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 86 column: 159 source: " if(G(a,c))return i;if(1==c.nodeType&&d)if(e=c.childNodes[d])c=e,d=0;else if(G(c,a))return l;return 0<(cb(a,c)||b-d)};fu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 92 column: 240 source: "ts.length;b++)var d=(""+arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function l(a){return a.replace"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 95 column: 985 source: "f;L.prototype.c=0;L.prototype.d=g;function M(a,c,b){if(a.b=c)a.c="number"==typeof b?b:1!=a.b.nodeType?0:a.a?-1:1}
E/GeckoConsole( 4771): "}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 98 column: 86 source: "||c,d=a[b];if(void 0===d&&0<=u(R,b))return g;if(b="value"==c)if(b=O(a,"OPTION")){var e;b=c.toLowerCase();if(a.hasAttribu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 98 column: 105 source: "0===d&&0<=u(R,b))return g;if(b="value"==c)if(b=O(a,"OPTION")){var e;b=c.toLowerCase();if(a.hasAttribute)e=a.hasAttribute"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 104 column: 364 source: "ts.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function p(a){return a.replace"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 108 column: 602 source: ")return h;a=a.nextSibling}return j}function ma(a,b){for(var a=a.parentNode,c=0;a;){if(b(a))return a;a=a.parentNode;c++}r"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 109 column: 25 source: "function na(a){var b=a.g,a="CSS1Compat"==b.compatMode?b.documentElement:b.body,b=b.pa"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 111 column: 730 source: "i;Q.prototype.c=0;Q.prototype.e=j;function R(a,b,c){if(a.b=b)a.c="number"==typeof c?c:1!=a.b.nodeType?0:a.a?-1:1}
E/GeckoConsole( 4771): "}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 114 column: 76 source: "or(var b=L(a),c=T(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=T(a,"position"),d"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 120 column: 285 source: "b=V(a);if(b&&"hidden"==W(b,"overflow")){var c=xa(b),d=ta(b),a=ta(a);return d.x+c.width<a.x||d.y+c.height<a.y?j:e(b)}retu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 121 column: 142 source: "usemap = "#'+a.name+'"]',f):la(f,function(b){var c;if(c=U(b))8==b.nodeType?b=i:(c="usemap","style"==c?(b=p(b.style.cssTe"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 125 column: 359 source: "aultView:window)==da.top?p(b.title):"";b=[];Aa(a,b);var d=b,a=d.length;b=Array(a);for(var d=m(d)?d.split(""):d,e=0;e<a;e"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 128 column: 249 source: "ts.length;b++)var d=(""+arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a};var h,i="",j=/rv\:([^\);]+)(\"}]
E/GeckoConsole( 4771): [JavaScript Warning: "TypeError: variable a redeclares argument" {file: "chrome://marionette/content/atoms.js" line: 133 column: 255 source: "ts.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a};var k,l="",m=/rv\:([^\);]+)(\"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 136 column: 1492 source: "o"==c)b="checked";var c=b,d=J[c]||c,b=a[d],e;if(e=void 0===b){b:if("string"==typeof K)d="string"!=typeof d||1!=d.length?"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 136 column: 1672 source: "]===d){d=e;break b}d=-1}e=0<=d}if(e)a=f;else{if(d="value"==c)if(d=H(a,"OPTION")){var j;c=c.toLowerCase();if(a.hasAttribu"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 136 column: 1691 source: "d=-1}e=0<=d}if(e)a=f;else{if(d="value"==c)if(d=H(a,"OPTION")){var j;c=c.toLowerCase();if(a.hasAttribute)j=a.hasAttribute"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 155 column: 491 source: "!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;ret"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 167 column: 884 source: "new K,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
E/GeckoConsole( 4771): "}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 169 column: 144 source: "&&a.matches(f)&&e.add(f),e=J(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);P("following-sibling",function(a,b){for(v"}]
E/GeckoConsole( 4771): [JavaScript Warning: "SyntaxError: test for equality (==) mistyped as assignment (=)?" {file: "chrome://marionette/content/atoms.js" line: 170 column: 85 source: "b,c,d){var e=new K,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,w=f.length;g<w;g++){var p=[];for(b=f[g];b=b.pr"}]
Can we fix this?
Flags: needinfo?(mdas)
Flags: needinfo?(jlal)
Flags: needinfo?(jgriffin)
These are Selenium atoms, owned by dburns.
Flags: needinfo?(mdas)
Flags: needinfo?(jlal)
Flags: needinfo?(jgriffin)
Flags: needinfo?(dburns)
We generate this from https://code.google.com/p/selenium/source/browse/#git%2Fjavascript%2Fatoms to get the necessary parts and then we run them could through closure... I wonder if closure is being a little silly
Flags: needinfo?(dburns)
(In reply to David Burns :automatedtester from comment #3)
> We generate this from
> https://code.google.com/p/selenium/source/browse/#git%2Fjavascript%2Fatoms
> to get the necessary parts and then we run them could through closure... I
> wonder if closure is being a little silly

So can we fix this? Its really annoying.
Flags: needinfo?(dburns)
The atoms from Selenium can be generated with `./go marionette:atoms` now.
the atoms are built as ES3 so having the rest as use strict is going to cause this problem. We need to do get the build script to understand how to build ES5, which isn't trivial when I last looked and we will need to then update the atoms which makes that fix slightly trickier
Flags: needinfo?(dburns)
Assignee: nobody → dburns
Status: NEW → ASSIGNED
Did you manage to test this patch yet?
Flags: needinfo?(anygregor)
Ugh busy with other stuff now. Thanks for reminding. I will keep the NI and try to take a look on monday.
Hm it doesn't fix the problem for me. I attached your patch, even did a clean build but I still see those warnings.
Flags: needinfo?(anygregor)
Not sure how loadSubScript works but is it using the strict command from the parent file?
http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-server.js#24
(In reply to Gregor Wagner [:gwagner] from comment #11)
> Not sure how loadSubScript works but is it using the strict command from the
> parent file?
> http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-
> server.js#24

Yes, it loads the script into the context and scope where loadSubScript is called.  The solution is to make it a JS module and load it using Cu.import.

I'm working on a patch that refactors large portions of Marionette that fixes this problem, but if it's useful to you I can extract the modularisation of atoms/atom.js and apply that as a separate patch?
(In reply to Andreas Tolfsen (:ato) from comment #12)
> (In reply to Gregor Wagner [:gwagner] from comment #11)
> > Not sure how loadSubScript works but is it using the strict command from the
> > parent file?
> > http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-
> > server.js#24
> 
> Yes, it loads the script into the context and scope where loadSubScript is
> called.  The solution is to make it a JS module and load it using Cu.import.
> 
> I'm working on a patch that refactors large portions of Marionette that
> fixes this problem, but if it's useful to you I can extract the
> modularisation of atoms/atom.js and apply that as a separate patch?

I think its good enough if we have a plan to fix it in the mid-term. I don't think we need a short-term solution.
(In reply to Andreas Tolfsen (:ato) from comment #12)
> (In reply to Gregor Wagner [:gwagner] from comment #11)
> > Not sure how loadSubScript works but is it using the strict command from the
> > parent file?
> > http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-
> > server.js#24
> 
> Yes, it loads the script into the context and scope where loadSubScript is
> called.  The solution is to make it a JS module and load it using Cu.import.
> 
> I'm working on a patch that refactors large portions of Marionette that
> fixes this problem, but if it's useful to you I can extract the
> modularisation of atoms/atom.js and apply that as a separate patch?

My patch removed the strict directive of the parent so there must be something that I am missing. I will do the proper fix and go fix how the atoms are built in the first place, modularisation of marionette isnt going to solve the problem when the atoms are built for ES3
(In reply to David Burns :automatedtester from comment #14)
> (In reply to Andreas Tolfsen (:ato) from comment #12)
> > (In reply to Gregor Wagner [:gwagner] from comment #11)
> > > Not sure how loadSubScript works but is it using the strict command from the
> > > parent file?
> > > http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-
> > > server.js#24
> > 
> > Yes, it loads the script into the context and scope where loadSubScript is
> > called.  The solution is to make it a JS module and load it using Cu.import.
> > 
> > I'm working on a patch that refactors large portions of Marionette that
> > fixes this problem, but if it's useful to you I can extract the
> > modularisation of atoms/atom.js and apply that as a separate patch?
> 
> My patch removed the strict directive of the parent so there must be
> something that I am missing.

Did you remove it from marionette-listener.js?  That is also imported using loadSubScript I believe, so the problem cascades.
Setting the "javascript.options.strict.debug" pref to false on launch appears to suppress the warnings on a desktop build.
I believe this problem was resolved when I patched Marionette to not import the file using loadSubScript, but with using Cu.import, and removing the "use strict" directive.
Assignee: dburns → nobody
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: