MCPcopy Index your code
hub / github.com/angular-ui/ui-router / ensureSafeObject

Function ensureSafeObject

test/angular/1.2/angular.js:10231–10256  ·  view source on GitHub ↗
(obj, fullExpression)

Source from the content-addressed store, hash-verified

10229}
10230
10231function ensureSafeObject(obj, fullExpression) {
10232 // nifty check if obj is Function that is fast and works across iframes and other contexts
10233 if (obj) {
10234 if (obj.constructor === obj) {
10235 throw $parseMinErr('isecfn',
10236 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
10237 fullExpression);
10238 } else if (// isWindow(obj)
10239 obj.document && obj.location && obj.alert && obj.setInterval) {
10240 throw $parseMinErr('isecwindow',
10241 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
10242 fullExpression);
10243 } else if (// isElement(obj)
10244 obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
10245 throw $parseMinErr('isecdom',
10246 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
10247 fullExpression);
10248 } else if (// block Object so that we can't get hold of dangerous Object.* methods
10249 obj === Object) {
10250 throw $parseMinErr('isecobj',
10251 'Referencing Object in Angular expressions is disallowed! Expression: {0}',
10252 fullExpression);
10253 }
10254 }
10255 return obj;
10256}
10257
10258var CALL = Function.prototype.call;
10259var 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