|
Last change
on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Working / before login
|
-
Property mode
set to
100644
|
|
File size:
495 bytes
|
| Line | |
|---|
| 1 | 'use strict'
|
|---|
| 2 |
|
|---|
| 3 | let Node = require('./node')
|
|---|
| 4 |
|
|---|
| 5 | class Declaration extends Node {
|
|---|
| 6 | get variable() {
|
|---|
| 7 | return this.prop.startsWith('--') || this.prop[0] === '$'
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | constructor(defaults) {
|
|---|
| 11 | if (
|
|---|
| 12 | defaults &&
|
|---|
| 13 | typeof defaults.value !== 'undefined' &&
|
|---|
| 14 | typeof defaults.value !== 'string'
|
|---|
| 15 | ) {
|
|---|
| 16 | defaults = { ...defaults, value: String(defaults.value) }
|
|---|
| 17 | }
|
|---|
| 18 | super(defaults)
|
|---|
| 19 | this.type = 'decl'
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | module.exports = Declaration
|
|---|
| 24 | Declaration.default = Declaration
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.