Skip to content

Commit 0755a61

Browse files
author
Marek Sierociński
committed
feat: Adding location and navigator to allowed global objects array
1 parent bbdc431 commit 0755a61

File tree

9 files changed

+20
-14
lines changed

9 files changed

+20
-14
lines changed

dist/meval.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* meval v0.6.1 | Copyright 2019 (c) Marek Sierociński| https://github.com/marverix/meval/blob/master/LICENSE */
1+
/* meval v0.6.2 | Copyright 2019 (c) Marek Sierociński| https://github.com/marverix/meval/blob/master/LICENSE */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -31,7 +31,7 @@
3131
REGEXP.INTEGER = '[0-9]+';
3232
REGEXP.BOOLEAN = 'true|false';
3333
REGEXP.GLOBAL_PROPERTIES = 'undefined|null|NaN|Infinity';
34-
var ALLOWED_GLOBAL_OBJECTS = ['String', 'Number', 'Array', 'Object', 'Date', 'Math'];
34+
var ALLOWED_GLOBAL_OBJECTS = ['String', 'Number', 'Array', 'Object', 'Date', 'Math', 'location', 'navigator'];
3535
/**
3636
* Get regexp string for 1 argument operator
3737
* @param {String} op Operator

dist/meval.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Constants.js.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<h1><a href="index.html" class="link">meval</a></h1>
3030
<span class="version">
3131

32-
v0.6.1
32+
v0.6.2
3333

3434
</span>
3535
</div>
@@ -66,7 +66,10 @@ <h1><a href="index.html" class="link">meval</a></h1>
6666
REGEXP.BOOLEAN = 'true|false';
6767
REGEXP.GLOBAL_PROPERTIES = 'undefined|null|NaN|Infinity';
6868

69-
const ALLOWED_GLOBAL_OBJECTS = ['String', 'Number', 'Array', 'Object', 'Date', 'Math'];
69+
const ALLOWED_GLOBAL_OBJECTS = [
70+
'String', 'Number', 'Array', 'Object', 'Date', 'Math',
71+
'location', 'navigator'
72+
];
7073

7174
/**
7275
* Get regexp string for 1 argument operator

docs/Evaluation.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<h1><a href="index.html" class="link">meval</a></h1>
3030
<span class="version">
3131

32-
v0.6.1
32+
v0.6.2
3333

3434
</span>
3535
</div>

docs/global.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<h1><a href="index.html" class="link">meval</a></h1>
2929
<span class="version">
3030

31-
v0.6.1
31+
v0.6.2
3232

3333
</span>
3434
</div>
@@ -762,7 +762,7 @@ <h4 class="name" id="get1ArgOpRegex">
762762
<span class="type-signature"></span>
763763

764764
<span class="source">
765-
<a href="Constants.js.html#line20"><i class="source fa fa-file-code-o"></i></a>
765+
<a href="Constants.js.html#line23"><i class="source fa fa-file-code-o"></i></a>
766766
</span>
767767
</h4>
768768

@@ -904,7 +904,7 @@ <h4 class="name" id="get2ArgOpRegex">
904904
<span class="type-signature"></span>
905905

906906
<span class="source">
907-
<a href="Constants.js.html#line28"><i class="source fa fa-file-code-o"></i></a>
907+
<a href="Constants.js.html#line31"><i class="source fa fa-file-code-o"></i></a>
908908
</span>
909909
</h4>
910910

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<h1><a href="index.html" class="link">meval</a></h1>
2929
<span class="version">
3030

31-
v0.6.1
31+
v0.6.2
3232

3333
</span>
3434
</div>

docs/meval.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<h1><a href="index.html" class="link">meval</a></h1>
3030
<span class="version">
3131

32-
v0.6.1
32+
v0.6.2
3333

3434
</span>
3535
</div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meval",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "Mimic eval in given context",
55
"main": "dist/meval.js",
66
"scripts": {

src/Constants.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ REGEXP.INTEGER = '[0-9]+';
1111
REGEXP.BOOLEAN = 'true|false';
1212
REGEXP.GLOBAL_PROPERTIES = 'undefined|null|NaN|Infinity';
1313

14-
const ALLOWED_GLOBAL_OBJECTS = ['String', 'Number', 'Array', 'Object', 'Date', 'Math'];
14+
const ALLOWED_GLOBAL_OBJECTS = [
15+
'String', 'Number', 'Array', 'Object', 'Date', 'Math',
16+
'location', 'navigator'
17+
];
1518

1619
/**
1720
* Get regexp string for 1 argument operator

0 commit comments

Comments
 (0)