<commit_before>
// Code, that sets up some global squeak-variables, after all classes have been loaded.
// Also, initializes all instance-variables to nil, as it's available now.

// Setup depends on: classes, classes.js
// Runtime depends on: -

// API (not a real API, just values mostly used in compiled code):
// st.primitiveDeclaration (function())
// st.true
// st.false
// st.nil

(function() {

	// Set up the namespace
	var home = window.st ? window.st : (window.st = {});

	// Function called when a method with an unimplemented primitive declaration is called
	home.primitiveDeclaration = function() {
		var current = st.peekCallStack();
		throw("Primitive has been called!!! The method containing it is: \n\n" + 
			current.currentThis._theClass._classname + "." +
			current.currentMethod.methodName + "\n(implemented in class " + 
			current.currentMethod.methodHome._theClass._classname + ")");
	};

	// Set up immutable globals
	home.true = st.True._newInstance();
	home.false = st.False._newInstance();
	home.nil = st.UndefinedObject._newInstance();

	// Now, that nil is available, initialize all instance-variables of all classes to nil
	for (aClass in st.classes) {
		st.classes[aClass]._initializeInstanceVariables(home.nil);
	}<commit_msg>extended error-message that pops up when a primitive is called.<commit_after>
// Code, that sets up some global squeak-variables, after all classes have been loaded.
// Also, initializes all instance-variables to nil, as it's available now.

// Setup depends on: classes, classes.js
// Runtime depends on: -

// API (not a real API, just values mostly used in compiled code):
// st.primitiveDeclaration (function())
// st.true
// st.false
// st.nil

(function() {

	// Set up the namespace
	var home = window.st ? window.st : (window.st = {});

	// Function called when a method with an unimplemented primitive declaration is called
	home.primitiveDeclaration = function() {
		var current = st.peekCallStack();
		var msg = "Primitive has been called!!! The method containing it is: \n" +
			"\n" +
			current.currentThis._theClass._classname + "." + current.currentMethod.methodName + "\n" +
			"(implemented in class " + current.currentMethod.methodHome._theClass._classname + ")\n" +
			"\n" +
			"You can either rely on the software-implementation of this primitive " +
			" and add this method to the list in OrcaSqueakAstToJsAst class >> #ignoredPrimitives\n" +
			"Or you implement the primitive in a Javascript-file in the primitives/-subfolder.\n" +
			"The file must be called <name of the home-class of the primitive>.js and is included automatically.\n" +
			"If it is not there, create it.";
		alert(msg)
		throw msg;
	};

	// Set up immutable globals
	home.true = st.True._newInstance();
	home.false = st.False._newInstance();
	home.nil = st.UndefinedObject._newInstance();

	// Now, that nil is available, initialize all instance-variables of all classes to nil
	for (aClass in st.classes) {
		st.classes[aClass]._initializeInstanceVariables(home.nil);
	}
{'fraction_non_alphanumeric': 0.1188118811881188, 'fraction_numerical': 0.0, 'mean_word_length': 3.713841368584759, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '3776118', 'n_tokens_mistral': 931, 'n_tokens_neox': 874, 'n_words': 313}