Bug 169321 - Passing strings generated by .match or .substr into Components.lookupMethod() was throwing exceptions because those strings

are not atomized.
Checking in for Johnny Stenback <jst@netscape.com>
r=dbradley@netscape.com, jaggernaut@netscape.com
sr=brendan@mozilla.org
This commit is contained in:
caillon%returnzero.com 2002-09-18 13:44:43 +00:00
Родитель 6c61080e81
Коммит 1c6a6a549a
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -1825,6 +1825,14 @@ NS_IMETHODIMP nsXPCComponents::LookupMethod()
if(!JSVAL_IS_STRING(argv[1]))
return NS_ERROR_XPC_BAD_CONVERT_JS;
// Make sure the name (argv[1]) that we use for looking up the
// method/property is atomized.
jsid name_id;
if(!JS_ValueToId(cx, argv[1], &name_id) ||
!JS_IdToValue(cx, name_id, &argv[1]))
return NS_ERROR_XPC_BAD_CONVERT_JS;
// this will do verification and the method lookup for us
XPCCallContext inner_cc(JS_CALLER, cx, obj, nsnull, argv[1]);