Skip to content

TypeError: 'regExp.get$pattern' is not a function – thrown on Opera, Android browser #3812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Jun 21, 2012 · 10 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js

Comments

@DartBot
Copy link

DartBot commented Jun 21, 2012

This issue was originally filed by @filiph


What steps will reproduce the problem?

  1. Try to load http://egamebook.com/test from the Android browser or from Opera (incl. Mobile Opera) - Opera will give you a stack trace, Android browser won't
  2. See how it fails with an error: Uncaught exception: TypeError: 'p.set$_next' is not a function

What is the expected output? What do you see instead?
In Chrome, Chrome for Android, Safari, Firefox, Firefox for Android – the "web app" initializes and runs without errors.

What version of the product are you using? On what operating system?
Using the latest build on Mac OS X – rev 8973.

Please provide any additional information below.

The generated javascript is here: http://egamebook.com/test/tis_001.html.dart.js. The program uses 2 isolates that communicate with each other. But the problem seems more elementary than that.

Full stack trace (Opera)
Error thrown at line 7401, column 2 in <anonymous function: $.regExpMakeNative>(regExp, global) in http://egamebook.com/test/tis_001.html.dart.js:
    var pattern = $.stringTypeCheck(regExp.get$pattern());
called from line 8330, column 2 in <anonymous function: $.regExpGetNative>(regExp) in http://egamebook.com/test/tis_001.html.dart.js:
    return r === (void 0) ? (regExp._re = $.regExpMakeNative(regExp, false)) : r;
called from line 7205, column 2 in <anonymous function: $.regExpTest>(regExp, str) in http://egamebook.com/test/tis_001.html.dart.js:
    return $.regExpGetNative(regExp).test(str);
called from line 902, column 2 in <anonymous function: hasMatch$1>(str) in http://egamebook.com/test/tis_001.html.dart.js:
    return $.regExpTest(this, $.checkString($.stringTypeCheck(str)));
called from line 7332, column 62 in <anonymous function: $.stringContainsUnchecked>(receiver, other, startIndex) in http://egamebook.com/test/tis_001.html.dart.js:
    return other.hasMatch$1($.substring$1(receiver, startIndex));
called from line 8520, column 2 in <anonymous function: $.contains$2>(receiver, other, startIndex) in http://egamebook.com/test/tis_001.html.dart.js:
    return $.stringContainsUnchecked(receiver, other, startIndex);
called from line 7021, column 2 in <anonymous function: $.contains$1>(receiver, other) in http://egamebook.com/test/tis_001.html.dart.js:
    return $.contains$2(receiver, other, 0);
called from line 9062, column 2 in <anonymous function: $.getFunctionForTypeNameOf>() in http://egamebook.com/test/tis_001.html.dart.js:
    if ($.contains$1(userAgent, $.CTC15) === true)
called from line 9338, column 37 in <anonymous function: $.getTypeNameOf>(obj) in http://egamebook.com/test/tis_001.html.dart.js:
    $._getTypeNameOf = $.getFunctionForTypeNameOf();
called from line 9024, column 2 in <anonymous function: $.dynamicBind&gt;(obj, name$, methods, arguments$) in http://egamebook.com/test/tis_001.html.dart.js:
    var tag = $.stringTypeCheck($.getTypeNameOf(obj));

@sethladd
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jul 11, 2012

This comment was originally written by @bp74


The "Build Bot" of Dart shows everything in green for Opera, but the problem still exists. You can't even start the included sample apps (like Clock) in Opera 12 on the Desktop. I think Opera 12 as a modern browser, which should be able to run JavaScript generated by Dart2Js. Even Opera 12 has no big market share, people ask my why my app is not running in Opera.

@floitschG
Copy link
Contributor

Set owner to @floitschG.
Removed Priority-Medium label.
Added Priority-High, Accepted labels.

@DartBot
Copy link
Author

DartBot commented Jul 15, 2012

This comment was originally written by @filiph


FYI: the latest Android browser version now runs the script without problems. It seems the issue persists on Opera, though.

@floitschG
Copy link
Contributor

Thanks for the Android update.

Wrt Opera: so far I have identified the reasons for the Opera incompatibility. There is a bug in Opera (where it handles modifications to proto the wrong way), and one unspecified behavior where Opera differs from the other browsers.
I'm working on the fixes now.

@floitschG
Copy link
Contributor

CL uploaded: https://chromiumcodereview.appspot.com/10781019/

Note: when patching DOM objects we look at the names of the instances. Unfortunately some browsers differ (for example 'HTMLDocument' vs 'Document', or 'Window' vs 'DOMWindow').
I fixed the one ('Window') I saw, but there might be others that are missing. If you see NoSuchMethodExceptions on DOM elements, this could be the reason. We are going to improve the test-coverage for Opera, but until that happens, please file bug-reports if you see NoSuchMethodExceptions on DOM elements.


Added Started label.

@vsmenon
Copy link
Member

vsmenon commented Jul 18, 2012

Looks like practically any Dart app in Opera is hitting this bug first. Here's the simplest test case I could recreate this with:

void checkPattern(r) {
  Expect.equals('Hello', r.pattern);
}

void main() {
  var r = new RegExp('Hello');
  checkPattern(r);
}

Works in Dartium and Chrome. Throws on Opera.

@vsmenon
Copy link
Member

vsmenon commented Jul 18, 2012

Issue #4111 has been merged into this issue.

@vsmenon
Copy link
Member

vsmenon commented Jul 18, 2012

Issue #2397 has been merged into this issue.


cc @dgrove.
cc @sethladd.
cc @kwalrath.
cc @kasperl.
cc @rakudrama.

@floitschG
Copy link
Contributor

Fixed in r9736.
Opened another bug to make sure we start testing Opera correctly: issue #4134

Note: Opera came already back to me. The proto bug has been fixed in their trunk.


Added Fixed label.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js labels Jul 18, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants