Bug 1037718 - Remove JS_GetTypeName. r=jwalden.

--HG--
extra : rebase_source : aeed86df0181573e6391be52a0114107cba06369
This commit is contained in:
Jason Orendorff 2014-08-06 07:17:04 -05:00
Родитель c861809092
Коммит a5ca480b50
7 изменённых файлов: 8 добавлений и 29 удалений

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

@ -5865,7 +5865,7 @@ FunctionType::Call(JSContext* cx,
// Since we know nothing about the CTypes of the ... arguments,
// they absolutely must be CData objects already.
JS_ReportError(cx, "argument %d of type %s is not a CData object",
i, JS_GetTypeName(cx, JS_TypeOfValue(cx, args[i])));
i, InformalValueTypeName(args[i]));
return false;
}
if (!(type = CData::GetCType(obj)) ||

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

@ -450,14 +450,6 @@ JS_TypeOfValue(JSContext *cx, HandleValue value)
return TypeOfValue(value);
}
JS_PUBLIC_API(const char *)
JS_GetTypeName(JSContext *cx, JSType type)
{
if ((unsigned)type >= (unsigned)JSTYPE_LIMIT)
return nullptr;
return TypeStrings[type];
}
JS_PUBLIC_API(bool)
JS_StrictlyEqual(JSContext *cx, jsval value1, jsval value2, bool *equal)
{

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

@ -1186,9 +1186,6 @@ ToUint64(JSContext *cx, JS::HandleValue v, uint64_t *out)
extern JS_PUBLIC_API(JSType)
JS_TypeOfValue(JSContext *cx, JS::Handle<JS::Value> v);
extern JS_PUBLIC_API(const char *)
JS_GetTypeName(JSContext *cx, JSType type);
extern JS_PUBLIC_API(bool)
JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, bool *equal);

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

@ -45,16 +45,6 @@ js::AtomToPrintableString(ExclusiveContext *cx, JSAtom *atom, JSAutoByteString *
return bytes->encodeLatin1(cx, str);
}
const char * const js::TypeStrings[] = {
js_undefined_str,
js_object_str,
js_function_str,
js_string_str,
js_number_str,
js_boolean_str,
js_null_str,
};
#define DEFINE_PROTO_STRING(name,code,init,clasp) const char js_##name##_str[] = #name;
JS_FOR_EACH_PROTOTYPE(DEFINE_PROTO_STRING)
#undef DEFINE_PROTO_STRING

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

@ -176,8 +176,6 @@ extern const char js_with_str[];
namespace js {
extern const char * const TypeStrings[];
/*
* Atom tracing and garbage collection hooks.
*/

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

@ -5637,7 +5637,9 @@ js::DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValu
RootedValue val(cx, ObjectValue(*obj));
js_ReportValueError2(cx, JSMSG_CANT_CONVERT_TO, JSDVG_SEARCH_STACK, val, str,
(hint == JSTYPE_VOID) ? "primitive type" : TypeStrings[hint]);
hint == JSTYPE_VOID
? "primitive type"
: hint == JSTYPE_STRING ? "string" : "number");
return false;
}

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

@ -3310,7 +3310,7 @@ Compile(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!args[0].isString()) {
const char *typeName = JS_GetTypeName(cx, JS_TypeOfValue(cx, args[0]));
const char *typeName = InformalValueTypeName(args[0]);
JS_ReportError(cx, "expected string to compile, got %s", typeName);
return false;
}
@ -3350,7 +3350,7 @@ Parse(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!args[0].isString()) {
const char *typeName = JS_GetTypeName(cx, JS_TypeOfValue(cx, args[0]));
const char *typeName = InformalValueTypeName(args[0]);
JS_ReportError(cx, "expected string to parse, got %s", typeName);
return false;
}
@ -3397,7 +3397,7 @@ SyntaxParse(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!args[0].isString()) {
const char *typeName = JS_GetTypeName(cx, JS_TypeOfValue(cx, args[0]));
const char *typeName = InformalValueTypeName(args[0]);
JS_ReportError(cx, "expected string to parse, got %s", typeName);
return false;
}
@ -3534,7 +3534,7 @@ OffThreadCompileScript(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
if (!args[0].isString()) {
const char *typeName = JS_GetTypeName(cx, JS_TypeOfValue(cx, args[0]));
const char *typeName = InformalValueTypeName(args[0]);
JS_ReportError(cx, "expected string to parse, got %s", typeName);
return false;
}