Creates new script validation context if not done before and gets the script validation context.
425520
private ScriptValidationContext getScriptValidationContext() {
        if (scriptValidationContext == null) {
            scriptValidationContext = new ScriptValidationContext(messageType.toString());

            getAction().getValidationContexts().add(scriptValidationContext);
        }

        return scriptValidationContext;
    }
1057054
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEnumeration == null) {
			this.container = script;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			script.getXtendTypes().add(this.sarlEnumeration);
			this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
433602
def validate(context_name = default_validation_context)
      errors.clear
      validation_violations(context_name).each { |v| errors.add(v) }

      self
    end
477597
public static Object eval(String script, ScriptContext context) throws ScriptRuntimeException {
		try {
			return compile(script).eval(context);
		} catch (ScriptException e) {
			throw new ScriptRuntimeException(e);
		}
	}
628963
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlSkill == null) {
			this.sarlSkill = SarlFactory.eINSTANCE.createSarlSkill();
			script.getXtendTypes().add(this.sarlSkill);
			this.sarlSkill.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlSkill.setName(name);
			}
		}
	}
759305
private static void validateScriptProviderDef(final ProviderDef pluginDef) throws PluginException {
        if (null == pluginDef.getName() || "".equals(pluginDef.getName())) {
            throw new PluginException("Script plugin missing name");
        }
        if (null == pluginDef.getService() || "".equals(pluginDef.getService())) {
            throw new PluginException("Script plugin missing service");
        }
        if (null == pluginDef.getScriptFile() || "".equals(pluginDef.getScriptFile())) {
            throw new PluginException("Script plugin missing script-file");
        }

        //make sure service is pluggable service and is script pluggable
        /* final FrameworkSupportService service = framework.getService(pluginDef.getService());
        if (!(service instanceof PluggableService)) {
            throw new PluginException(
                "Service '" + pluginDef.getService() + "' specified for script plugin '" + pluginDef.getName()
                + "' is not valid: unsupported");
        }
        final PluggableService pservice = (PluggableService) service;
        if (!pservice.isScriptPluggable()) {
            throw new PluginException(
                "Service '" + pluginDef.getService() + "' specified for script plugin '" + pluginDef.getName()
                + "' is not valid: unsupported");
        }*/
    }
477431
public ExecuteSQLQueryBuilder validateScript(Resource scriptResource, String type, Charset charset) {
        ScriptValidationContext scriptValidationContext = new ScriptValidationContext(type);
        try {
            scriptValidationContext.setValidationScript(FileUtils.readToString(scriptResource, charset));
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read script resource", e);
        }
        action.setScriptValidationContext(scriptValidationContext);
        return this;
    }
1061093
private ScriptText createScriptText(int key, BMRule rule)
   {
      StringBuilder builder = new StringBuilder();
      builder.append("# BMUnit autogenerated script: ").append(rule.name());

      builder.append("\nRULE ");
      builder.append(rule.name());
      if (rule.isInterface())
      {
         builder.append("\nINTERFACE ");
      }
      else
      {
         builder.append("\nCLASS ");
      }

      builder.append(rule.targetClass());
      builder.append("\nMETHOD ");
      builder.append(rule.targetMethod());

      String location = rule.targetLocation();
      if (location != null && location.length() > 0)
      {
         builder.append("\nAT ");
         builder.append(location);
      }

      String binding = rule.binding();
      if (binding != null && binding.length() > 0)
      {
         builder.append("\nBIND ");
         builder.append(binding);
      }

      String helper = rule.helper();
      if (helper != null && helper.length() > 0)
      {
         builder.append("\nHELPER ");
         builder.append(helper);
      }

      builder.append("\nIF ");
      builder.append(rule.condition());
      builder.append("\nDO ");
      builder.append(rule.action());
      builder.append("\nENDRULE\n");

      return new ScriptText("IronJacamarWithByteman" + key, builder.toString());
   }
1163138
def create
      @script_extension = Script::Extension.new(script_extension_params)
      @script_extension.user_id = current_user.id
      @script_extension.org_id = current_user.org_id
      if @script_extension.save
        redirect_to script_extensions_url, notice: 'Extension was successfully created.'
        else
        render :new
      end
    end
16226
private String getInterfaceScript(String scriptName,
			final GeneratorContext context) throws IOException {
		Container container = getContainer(context);
		CreatorManager ctManager = (CreatorManager) container
				.getBean(CreatorManager.class.getName());
		if (ctManager.getCreator(scriptName, false) != null) {
			InterfaceHandler handler = (InterfaceHandler) ContainerUtil
					.getHandlerForUrlProperty(container, INTERFACE_HANDLER_URL);
			return handler.generateInterfaceScript(context.getServletContext()
					.getContextPath(), context.getConfig().getDwrMapping(),
					scriptName);
		} else
			throw new IllegalArgumentException("The DWR bean named '"
					+ scriptName
					+ "' was not found in any DWR configuration instance.");
	}
242048
function createContext(req, res, context, done) {
  debug('default createContext - does nothing', context);
  process.nextTick(done.bind(null, null, context));
}
894790
def new
      @script_version = Script::Version.new
      @script_version.user_id = current_user.id
      @script_version.org_id = current_user.org_id
    end
1231204
protected function addDoValidate(&$script)
    {
        $table = $this->getTable();

        $script .= "
    /**
     * This function performs the validation work for complex object models.
     *
     * In addition to checking the current object, all related objects will
     * also be validated.  If all pass then <code>true</code> is returned; otherwise
     * an aggregated array of ValidationFailed objects will be returned.
     *
     * @param array \$columns Array of column names to validate.
     * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objects otherwise.
     */
    protected function doValidate(\$columns = null)
    {
        if (!\$this->alreadyInValidation) {
            \$this->alreadyInValidation = true;
            \$retval = null;

            \$failureMap = array();
";
        if (count($table->getForeignKeys()) != 0) {
            $script .= "

            // We call the validate method on the following object(s) if they
            // were passed to this object by their corresponding set
            // method.  This object relates to these object(s) by a
            // foreign key reference.
";
            foreach ($table->getForeignKeys() as $fk) {
                $aVarName = $this->getFKVarName($fk);
                $script .= "
            if (\$this->" . $aVarName . " !== null) {
                if (!\$this->" . $aVarName . "->validate(\$columns)) {
                    \$failureMap = array_merge(\$failureMap, \$this->" . $aVarName . "->getValidationFailures());
                }
            }
";
            } /* for () */
        } /* if count(fkeys) */

        $script .= "

            if ((\$retval = " . $this->getPeerClassname() . "::doValidate(\$this, \$columns)) !== true) {
                \$failureMap = array_merge(\$failureMap, \$retval);
            }

";

        foreach ($table->getReferrers() as $refFK) {
            if ($refFK->isLocalPrimaryKey()) {
                $varName = $this->getPKRefFKVarName($refFK);
                $script .= "
                if (\$this->$varName !== null) {
                    if (!\$this->" . $varName . "->validate(\$columns)) {
                        \$failureMap = array_merge(\$failureMap, \$this->" . $varName . "->getValidationFailures());
                    }
                }
";
            } else {
                $collName = $this->getRefFKCollVarName($refFK);
                $script .= "
                if (\$this->$collName !== null) {
                    foreach (\$this->$collName as \$referrerFK) {
                        if (!\$referrerFK->validate(\$columns)) {
                            \$failureMap = array_merge(\$failureMap, \$referrerFK->getValidationFailures());
                        }
                    }
                }
";
            }
        } /* foreach getReferrers() */

        $script .= "

            \$this->alreadyInValidation = false;
        }

        return (!empty(\$failureMap) ? \$failureMap : true);
    }
";
    }
800833
public ExecuteSQLQueryBuilder validateScript(String script, String type) {
        ScriptValidationContext scriptValidationContext = new ScriptValidationContext(type);
        scriptValidationContext.setValidationScript(script);
        action.setScriptValidationContext(scriptValidationContext);
        return this;
    }
1096831
function createContext(script) {
  const INITIAL_CONTEXT = {
    vars: {
      target: script.config.target,
      $environment: script._environment,
      $processEnvironment: process.env
    },
    funcs: {
      $randomNumber: $randomNumber,
      $randomString: $randomString,
      $template: input => engineUtil.template(input, { vars: result.vars })
    }
  };

  let result = _.cloneDeep(INITIAL_CONTEXT);

  // variables from payloads:
  const variableValues1 = datafileVariables(script);
  Object.assign(result.vars, variableValues1);
  // inline variables:
  const variableValues2 = inlineVariables(script);
  Object.assign(result.vars, variableValues2);

  result._uid = uuid.v4();
  result.vars.$uuid = result._uid;
  return result;
}
1149741
@Override
    public Script freshOutputScript(KeyPurpose purpose) {
        DeterministicKey followedKey = getKey(purpose);
        ImmutableList.Builder<ECKey> keys = ImmutableList.<ECKey>builder().add(followedKey);
        for (DeterministicKeyChain keyChain : followingKeyChains) {
            DeterministicKey followingKey = keyChain.getKey(purpose);
            checkState(followedKey.getChildNumber().equals(followingKey.getChildNumber()), "Following keychains should be in sync");
            keys.add(followingKey);
        }
        List<ECKey> marriedKeys = keys.build();
        Script redeemScript = ScriptBuilder.createRedeemScript(sigsRequiredToSpend, marriedKeys);
        return ScriptBuilder.createP2SHOutputScript(redeemScript);
    }
1331693
public void validate(JavaScriptObject newValues, final I_CmsJavaScriptObjectCallback onSuccess) {

        AsyncCallback<Map<String, String>> rpcCallback = new AsyncCallback<Map<String, String>>() {

            @SuppressWarnings("synthetic-access")
            public void onFailure(Throwable caught) {

                m_apiRoot.handleError(caught, null);
            }

            public void onSuccess(Map<String, String> result) {

                if (result == null) {
                    result = Maps.newHashMap();
                }
                onSuccess.call(CmsJsUtils.convertMapToJsObject(result));
            }
        };
        m_apiRoot.getRpcHelper().executeRpc(
            CmsXmlContentUgcApi.SERVICE.validateContent(
                m_content.getSessionId(),
                CmsJsUtils.convertJsObjectToMap(newValues),
                rpcCallback));

    }