diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/webpack-sources/lib/Source.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/webpack-sources/lib/Source.js')
-rw-r--r-- | node_modules/webpack-sources/lib/Source.js | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/node_modules/webpack-sources/lib/Source.js b/node_modules/webpack-sources/lib/Source.js index 1c729fcf1..c8300f44e 100644 --- a/node_modules/webpack-sources/lib/Source.js +++ b/node_modules/webpack-sources/lib/Source.js @@ -2,35 +2,44 @@ MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
+"use strict";
+
var SourceNode = require("source-map").SourceNode;
var SourceMapConsumer = require("source-map").SourceMapConsumer;
-function Source() {}
+class Source {
-module.exports = Source;
+ source() {
+ throw new Error("Abstract");
+ }
-Source.prototype.source = null;
+ size() {
+ return this.source().length;
+ }
-Source.prototype.size = function() {
- return this.source().length;
-};
+ map(options) {
+ return null;
+ }
-Source.prototype.map = function(options) {
- return null;
-};
+ sourceAndMap(options) {
+ return {
+ source: this.source(),
+ map: this.map()
+ };
+ }
-Source.prototype.sourceAndMap = function(options) {
- return {
- source: this.source(),
- map: this.map()
- };
-};
+ node() {
+ throw new Error("Abstract");
+ }
-Source.prototype.node = null;
+ listNode() {
+ throw new Error("Abstract");
+ }
-Source.prototype.listNode = null;
+ updateHash(hash) {
+ var source = this.source();
+ hash.update(source || "");
+ }
+}
-Source.prototype.updateHash = function(hash) {
- var source = this.source();
- hash.update(source || "");
-};
+module.exports = Source;
|