Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Simplified things a bit. #1

Open
wants to merge 1 commit into from

2 participants

Erik Lundin Peteris Krumins
Erik Lundin

JavaScript already supports Function#toString(), so I made use of it. Hopefully this pull request isn't missing the point.

Cheers!

Peteris Krumins
Owner

Nice one. I'll include this in my blog post about quine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  index.js
3  index.js
View
@@ -1,4 +1,3 @@
-var data = "module.exports = function () { console.log(\"var data = \\\"%s\\\"\\n%s\", data.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\"), data.replace(/{/, \"{\\n \").replace(/}$/, \"\\n}\")); }"
module.exports = function () {
- console.log("var data = \"%s\"\n%s", data.replace(/\\/g, "\\\\").replace(/"/g, "\\\""), data.replace(/{/, "{\n ").replace(/}$/, "\n}"));
+ console.log('module.exports = ' + arguments.callee.toString());
}
Something went wrong with that request. Please try again.