MCPcopy Create free account
hub / github.com/angular-ui/ui-router / ensureSafeObject

Function ensureSafeObject

test/angular/1.3/angular.js:11786–11811  ·  view source on GitHub ↗
(obj, fullExpression)

Source from the content-addressed store, hash-verified

11784}
11785
11786function ensureSafeObject(obj, fullExpression) {
11787 // nifty check if obj is Function that is fast and works across iframes and other contexts
11788 if (obj) {
11789 if (obj.constructor === obj) {
11790 throw $parseMinErr('isecfn',
11791 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
11792 fullExpression);
11793 } else if (// isWindow(obj)
11794 obj.window === obj) {
11795 throw $parseMinErr('isecwindow',
11796 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
11797 fullExpression);
11798 } else if (// isElement(obj)
11799 obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
11800 throw $parseMinErr('isecdom',
11801 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
11802 fullExpression);
11803 } else if (// block Object so that we can't get hold of dangerous Object.* methods
11804 obj === Object) {
11805 throw $parseMinErr('isecobj',
11806 'Referencing Object in Angular expressions is disallowed! Expression: {0}',
11807 fullExpression);
11808 }
11809 }
11810 return obj;
11811}
11812
11813var CALL = Function.prototype.call;
11814var APPLY = Function.prototype.apply;

Callers 3

angular.jsFile · 0.70
setterFunction · 0.70
esoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected