This commit is contained in:
Michael Bebenita 2015-03-13 16:57:56 -07:00
Родитель 9e9af34e22
Коммит a9e206c8ff
2 изменённых файлов: 6 добавлений и 1 удалений

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

@ -342,7 +342,7 @@ Native["java/lang/Class.newInstance0.()Ljava/lang/Object;"] = function() {
Native["java/lang/Class.newInstance1.(Ljava/lang/Object;)V"] = function(o) {
// The following can trigger an unwind.
var methodInfo = o.klass.classInfo.getMethodByNameString("<init>", "()V", false);
var methodInfo = o.klass.classInfo.getLocalMethodByNameString("<init>", "()V", false);
if (!methodInfo) {
throw $.newInstantiationException("Can't instantiate classes without a nullary constructor");
}

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

@ -1022,6 +1022,11 @@ module J2ME {
return this.getMethodByName(toUTF8(name), toUTF8(signature));
}
// This should only ever be used from code where the name and signature originate from JS strings.
getLocalMethodByNameString(name: string, signature: string): MethodInfo {
return this.getLocalMethodByName(toUTF8(name), toUTF8(signature));
}
getLocalMethodByName(utf8Name: Uint8Array, utf8Signature: Uint8Array): MethodInfo {
var i = this.indexOfMethod(utf8Name, utf8Signature);
if (i >= 0) {