Cross-context route creation throws error #1557

daguej opened this Issue Mar 26, 2013 · 0 comments


None yet
2 participants

daguej commented Mar 26, 2013

Because Express checks if path instanceof RegExp, it is impossible to create routes with RegExp literals in a separate V8 context.

var Contextify = require('contextify');
var ctx = Contextify({ RegExp:RegExp, app: anExpressApp });"
    app.get(new RegExp('...'), function() { ... }); // works because we share the `RegExp` global between contexts
    app.get(/.../, function() { ... }); // does not work

daguej added a commit to daguej/express that referenced this issue Apr 1, 2013

Possible fix for #1557, allows routes to be created using literal reg…
…exes across V8 contexts. Removes all uses of `instanceof`.

tj added a commit that referenced this issue Apr 13, 2013

@jonathanong jonathanong closed this Sep 8, 2013

rlidwka pushed a commit to rlidwka/express that referenced this issue Aug 6, 2014

@stoeffel stoeffel referenced this issue in tristaaan/101 Feb 10, 2015


refactoring regexp-pick #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment