<commit_before>package uk.co.uwcs.choob.support;

import java.io.*;
import org.mozilla.javascript.*;

public final class ObjectDBClassJSWrapper implements ObjectDBClass {
	private Function cls;
	
	public ObjectDBClassJSWrapper(Object obj) {
		if (!(obj instanceof Function)) {
			throw new RuntimeException("Trying to wrap a non-function type as a class!");
		}
		this.cls = (Function)obj;
	}
	
	public String getName() {
		Context cx = Context.enter();
		try {
			try {
				String ctorName = (String)JSUtils.getProperty((Scriptable)cls, "name");
				Scriptable scope = ((Scriptable)cls).getParentScope();
				
				// Get plugin name from scope (HACK)!
				String plugName = "<error>";
				while (scope != null) {
					try {
						plugName = (String)JSUtils.getProperty(scope, "__jsplugman_pluginName");
						scope = null;
					} catch (NoSuchFieldException e) {
						scope = scope.getParentScope();
					}
				}
				
				//if (cls instanceof InterpretedFunction) {
				//	System.out.println("  INTERPRETED!");
				//}
				
				
				//if (cx.lastInterpreterFrame != null) {
				//	source = Interpreter.getSourcePositionFromStack(cx, new int[0]);
				//}
				//getSourcePositionFromStack
				//salkdjs
				return "plugin." + plugName + "." + ctorName;
			} catch (NoSuchFieldException e) {
				// Do nothing.
			}
		} finally {
			cx.exit();
		}
		return "";
	}
	
	public Object newInstance() {
		Context cx = Context.enter();
		try {
			Scriptable scope = cls.getParentScope();
			return cls.construct(cx, scope, new Object[0]);
		} finally {
			cx.exit();
		}
	}
}<commit_msg>Remove some, uh, commented out code. Commenting of code will follow!<commit_after>package uk.co.uwcs.choob.support;

import java.io.*;
import org.mozilla.javascript.*;

public final class ObjectDBClassJSWrapper implements ObjectDBClass {
	private Function cls;
	
	public ObjectDBClassJSWrapper(Object obj) {
		if (!(obj instanceof Function)) {
			throw new RuntimeException("Trying to wrap a non-function type as a class!");
		}
		this.cls = (Function)obj;
	}
	
	public String getName() {
		Context cx = Context.enter();
		try {
			try {
				String ctorName = (String)JSUtils.getProperty((Scriptable)cls, "name");
				Scriptable scope = ((Scriptable)cls).getParentScope();
				
				// Get plugin name from scope (HACK)!
				String plugName = "<error>";
				while (scope != null) {
					try {
						plugName = (String)JSUtils.getProperty(scope, "__jsplugman_pluginName");
						scope = null;
					} catch (NoSuchFieldException e) {
						scope = scope.getParentScope();
					}
				}
				
				return "plugin." + plugName + "." + ctorName;
			} catch (NoSuchFieldException e) {
				// Do nothing.
			}
		} finally {
			cx.exit();
		}
		return "";
	}
	
	public Object newInstance() {
		Context cx = Context.enter();
		try {
			Scriptable scope = cls.getParentScope();
			return cls.construct(cx, scope, new Object[0]);
		} finally {
			cx.exit();
		}
	}
}
{'fraction_non_alphanumeric': 0.13412969283276452, 'fraction_numerical': 0.0010238907849829352, 'mean_word_length': 3.048342541436464, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6813007', 'n_tokens_mistral': 1135, 'n_tokens_neox': 928, 'n_words': 229}