1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 01:37:58 +01:00

Hackier but more reliable literal() stuff.

This commit is contained in:
Kris Maglione
2014-06-18 12:24:55 -07:00
parent fdf188166d
commit cde8cd6763
15 changed files with 66 additions and 63 deletions

View File

@@ -230,7 +230,10 @@ this.lazyRequire("util", ["FailedAssertion", "util"]);
literal.files = {};
literal.locations = {};
function literal(/* comment */) {
function literal(comment) {
if (comment)
return /^function.*?\/\*([^]*)\*\/(?:\/\* use strict \*\/)\s*\S$/.exec(comment)[1];
let { caller } = Components.stack;
while (caller && caller.language != 2)
caller = caller.caller;