Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/inventory.picotech.app/public_html/node_modules/is-expression/ drwxr-xr-x |
Viewing file: Select action/file-type: 'use strict'; var assert = require('assert'); var testit = require('testit'); var isExpression = require('./'); function passes(src, options) { testit(JSON.stringify(src, options), function () { options = options || {}; assert(isExpression(src, options)); }); } testit('passes', function () { passes('myVar'); passes('["an", "array", "\'s"].indexOf("index")'); passes('\npublic'); passes('abc // my comment', {lineComment: true}); passes('() => a'); passes('function (a = "default") {"use strict";}', {ecmaVersion: 6}); }); function error(src, line, col, options) { testit(JSON.stringify(src), function () { options = options || {}; assert(!isExpression(src, options)); options.throw = true; assert.throws(function () { isExpression(src, options); }, function (err) { assert.equal(err.loc.line, line); assert.equal(err.loc.column, col); assert(err.message); return true; }); }); } testit('fails', function () { error('', 1, 0); error('var', 1, 0); error('weird error', 1, 6); error('asdf}', 1, 4); error('\npublic', 2, 0, {strict: true}); error('abc // my comment', 1, 4); error('() => a', 1, 1, {ecmaVersion: 5}); error('function (a = "default") {"use strict";}', 1, 26); }); |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0034 ]-- |