weex-rax-framework
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { |
{ | ||
"name": "weex-rax-framework", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Rax framework for weex.", | ||
@@ -19,4 +19,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"runtime-shared": "^0.1.0", | ||
"rax": "^0.1.0" | ||
"runtime-shared": "^0.1.1", | ||
"rax": "^0.1.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
'use strict'; | ||
function freezePrototype() { | ||
Object.freeze(Object); | ||
Object.freeze(Array); | ||
Object.freeze(Object.prototype); | ||
Object.freeze(Array.prototype); | ||
Object.freeze(String.prototype); | ||
Object.freeze(Number.prototype); | ||
Object.freeze(Boolean.prototype); | ||
Object.freeze(Error.prototype); | ||
Object.freeze(Date.prototype); | ||
Object.freeze(Math.prototype); | ||
Object.freeze(RegExp.prototype); | ||
} | ||
freezePrototype(); | ||
import {Runtime, Instance} from 'weex-vdom-tester'; | ||
@@ -9,4 +27,2 @@ import {config} from 'weex-js-runtime'; | ||
Object.a = 1; | ||
global.callNative = () => {}; | ||
@@ -192,2 +208,27 @@ global.WXEnvironment = { | ||
it('run in Object.prototype freeze mode', () => { | ||
const code = ` | ||
function Foo(){} | ||
// Throw Error | ||
Foo.prototype.toString = function(){}; | ||
// Could use Foo.prototype = {toString(){}} | ||
`; | ||
expect(function() { | ||
instance.$create(code, __weex_options__, __weex_data__); | ||
}).toThrowError(/Cannot assign to read only property/); | ||
}); | ||
it('run in Object freeze mode', () => { | ||
const code = ` | ||
var foo = new Object(); | ||
// Throw Error | ||
foo.toString = function(){}; | ||
`; | ||
expect(function() { | ||
instance.$create(code, __weex_options__, __weex_data__); | ||
}).toThrowError(/Cannot assign to read only property/); | ||
}); | ||
it('define a module', () => { | ||
@@ -194,0 +235,0 @@ const code = ` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
476541
7323
Updatedrax@^0.1.1
Updatedruntime-shared@^0.1.1