Changeset 212085 in webkit
- Timestamp:
- Feb 10, 2017 12:15:47 AM (7 years ago)
- Location:
- branches/safari-603-branch
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-603-branch/JSTests/ChangeLog
r211509 r212085 1 2017-02-09 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r212009. rdar://problem/29939864 4 5 2017-02-09 Keith Miller <keith_miller@apple.com> 6 7 We should not allow Function.caller to be used on native functions 8 https://bugs.webkit.org/show_bug.cgi?id=165628 9 10 Reviewed by Mark Lam. 11 12 * stress/caller-native-code.js: Added. 13 (f): 14 1 15 2017-01-27 Matthew Hanson <matthew_hanson@apple.com> 2 16 -
branches/safari-603-branch/Source/JavaScriptCore/ChangeLog
r212049 r212085 1 2017-02-09 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r212009. rdar://problem/29939864 4 5 2017-02-09 Keith Miller <keith_miller@apple.com> 6 7 We should not allow Function.caller to be used on native functions 8 https://bugs.webkit.org/show_bug.cgi?id=165628 9 10 Reviewed by Mark Lam. 11 12 Also remove unneeded dynamic cast. 13 14 * runtime/JSFunction.cpp: 15 (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): 16 (JSC::JSFunction::callerGetter): 17 1 18 2017-02-09 Matthew Hanson <matthew_hanson@apple.com> 2 19 -
branches/safari-603-branch/Source/JavaScriptCore/runtime/JSFunction.cpp
r209897 r212085 2 2 * Copyright (C) 1999-2002 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003-2009, 2015-201 6Apple Inc. All rights reserved.4 * Copyright (C) 2003-2009, 2015-2017 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca) 6 6 * Copyright (C) 2007 Maks Orlovich … … 322 322 // See ES5.1 15.3.5.4 - Function.caller may not be used to retrieve a strict caller. 323 323 if (!caller.isObject() || !asObject(caller)->inherits(JSFunction::info())) { 324 // It isn't a JSFunction, but if it is a JSCallee from a program or call eval, return null.324 // It isn't a JSFunction, but if it is a JSCallee from a program or eval call or an internal constructor, return null. 325 325 if (jsDynamicCast<JSCallee*>(caller)) 326 if (jsDynamicCast<JSCallee*>(caller) || jsDynamicCast<InternalFunction*>(caller)) 326 327 return JSValue::encode(jsNull()); 327 328 return JSValue::encode(caller); 328 329 } 329 330 JSFunction* function = jsCast<JSFunction*>(caller); 330 if (function->isHostOrBuiltinFunction() || !function->jsExecutable()->isStrictMode()) 331 332 // Firefox returns null for native code callers, so we match that behavior. 333 if (function->isHostOrBuiltinFunction()) 334 return JSValue::encode(jsNull()); 335 if (!function->jsExecutable()->isStrictMode()) 331 336 return JSValue::encode(caller); 332 337 return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral("Function.caller used to retrieve strict caller")));
Note: See TracChangeset
for help on using the changeset viewer.