Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
872 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 |
|
---|
| 2 | /*!
|
---|
| 3 | * Stylus - Charset
|
---|
| 4 | * Copyright (c) Automattic <developer.wordpress.com>
|
---|
| 5 | * MIT Licensed
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /**
|
---|
| 9 | * Module dependencies.
|
---|
| 10 | */
|
---|
| 11 |
|
---|
| 12 | var Node = require('./node');
|
---|
| 13 |
|
---|
| 14 | /**
|
---|
| 15 | * Initialize a new `Charset` with the given `val`
|
---|
| 16 | *
|
---|
| 17 | * @param {String} val
|
---|
| 18 | * @api public
|
---|
| 19 | */
|
---|
| 20 |
|
---|
| 21 | var Charset = module.exports = function Charset(val){
|
---|
| 22 | Node.call(this);
|
---|
| 23 | this.val = val;
|
---|
| 24 | };
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * Inherit from `Node.prototype`.
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 | Charset.prototype.__proto__ = Node.prototype;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * Return @charset "val".
|
---|
| 34 | *
|
---|
| 35 | * @return {String}
|
---|
| 36 | * @api public
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 39 | Charset.prototype.toString = function(){
|
---|
| 40 | return '@charset ' + this.val;
|
---|
| 41 | };
|
---|
| 42 |
|
---|
| 43 | /**
|
---|
| 44 | * Return a JSON representation of this node.
|
---|
| 45 | *
|
---|
| 46 | * @return {Object}
|
---|
| 47 | * @api public
|
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | Charset.prototype.toJSON = function(){
|
---|
| 51 | return {
|
---|
| 52 | __type: 'Charset',
|
---|
| 53 | val: this.val,
|
---|
| 54 | lineno: this.lineno,
|
---|
| 55 | column: this.column,
|
---|
| 56 | filename: this.filename
|
---|
| 57 | };
|
---|
| 58 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.